HTML and CSS Question Answers
PART-A
1) What is HTML? Give the basic structure of an HTML page.
HTML (HyperText Markup Language) is the standard language for creating web pages. It provides
the basic structure
of a webpage using elements like headings, paragraphs, and lists. Web browsers interpret HTML to
display content.
Basic Structure:
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My Web Page</h1>
<p>This is a simple HTML page.</p>
</body>
</html>
2) Explain the HTML elements for creating ordered and unordered lists.
Ordered lists display items in a numbered sequence, while unordered lists use bullet points. These
lists help
organize content in a structured way.
Example:
<ol>
<li>Wake up</li>
<li>Brush your teeth</li>
<li>Have breakfast</li>
</ol>
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Grapes</li>
</ul>
3) Explain the CSS Box Model. Provide an example of applying a solid border.
The CSS Box Model defines how elements are structured on a webpage. It consists of content,
padding, border, and margin.
Example CSS:
.box {
border: 5px solid red;
padding: 10px;
margin: 20px;
4) List and explain different ways of specifying borders using CSS.
CSS provides different border styles:
- Solid: border: 2px solid blue;
- Dotted: border: 2px dotted green;
- Dashed: border: 2px dashed red;
- Double: border: 4px double black;
- Groove: border: 3px groove gray;
Each border style affects how elements appear on a webpage.