HTML and CSS Complete 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.
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.
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.
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;
5) Explain different ways of specifying color in CSS.
CSS allows color specification using Named Colors, Hex Codes, RGB, and HSL formats.
PART-B
1) What is CSS? Give the syntax for CSS.
CSS (Cascading Style Sheets) is used to style HTML elements. Example:
p { color: blue; font-size: 18px; }
2) Explain the src and href attributes in HTML.
- src: Used in <img> for images.
- href: Used in <a> for hyperlinks.
3) Explain how text shadow can be added using CSS.
CSS text-shadow property allows adding shadows to text.
Example: text-shadow: 2px 2px 5px gray;
4) Explain how fonts are specified using CSS.
Fonts are specified using font-family, font-size, font-weight, and font-style properties.