Answers Graded A+
What is the main purpose of the `DOCTYPE` declaration in HTML?
✔✔The `DOCTYPE` declaration defines the document type and version of HTML being used,
helping the browser render the page correctly.
How do you add a favicon to your website?
✔✔A favicon can be added by linking a small icon file in the `<head>` section using the `<link
rel="icon" href="path/to/icon.ico">` tag.
Which tag is used to create a hyperlink in HTML?
✔✔The `<a>` tag is used to create a hyperlink that links to another page or resource.
How can you ensure your CSS styles apply only to a specific element type?
✔✔You can use element selectors in your CSS, such as `div`, `h1`, or `p`, to apply styles only to
those specific elements.
What is the significance of the `<alt>` attribute in an `<img>` tag?
1
, ✔✔The `<alt>` attribute provides alternative text for an image, which is displayed if the image
cannot be loaded and improves accessibility for screen readers.
How do you center an element horizontally using CSS?
✔✔You can center a block element by setting `margin: auto` on the element and specifying a
width.
What is the purpose of media queries in CSS?
✔✔Media queries allow you to apply different styles based on the device's characteristics, such
as screen size or orientation, enabling responsive design.
What tag is used to create a definition list in HTML?
✔✔The `<dl>` tag is used to create a definition list, with `<dt>` for terms and `<dd>` for their
descriptions.
How do you change the font size of text using CSS?
✔✔The `font-size` property is used to change the size of text, with values like `12px`, `1em`, or
`100%`.
2