HTML CSS Detailed Answers (2)
HTML CSS Detailed Answers (2)
PART - A
HTML (HyperText Markup Language) is a standard language used to create and design web pages.
It structures web
content using various tags like headings, paragraphs, lists, and links. HTML elements are the
building blocks
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
2) Explain the HTML elements for creating ordered and unordered lists.
Lists in HTML help organize information systematically. There are two main types:
<!DOCTYPE html>
<html>
<head>
<title>HTML Lists</title>
</head>
<body>
<h2>Ordered List</h2>
<ol>
<li>Wake up</li>
<li>Have breakfast</li>
</ol>
<h2>Unordered List</h2>
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Grapes</li>
</ul>
</body>
</html>
3) Explain the CSS Box Model. Provide an example of applying a solid border of 5px width in red
color.
The CSS Box Model describes how HTML elements are structured as rectangular boxes. It consists
of:
Example CSS:
.box {
padding: 10px;
margin: 20px;
Example HTML:
PART - B
1) What is CSS? Give the syntax for CSS.
CSS (Cascading Style Sheets) is used to style HTML elements. It controls layout, color, font, and
other styles.
Syntax:
selector {
property: value;
Example:
p{
color: blue;
font-size: 18px;
Syntax:
Example:
h1 {
text-shadow: 2px 2px 5px gray;
Fonts are specified using font-family, font-size, font-weight, and font-style properties.
Example:
p{
font-size: 16px;
font-weight: bold;
font-style: italic;