Academy) Questions And Answers
Graded A+
What HTML element would you use to define a navigation bar?
✔✔The `<nav>` element is used to define a navigation bar in HTML.
How do you make an image responsive in CSS?
✔✔You can make an image responsive by setting its width to 100% and height to auto, like `img
{ width: 100%; height: auto; }`.
What is the purpose of the `<aside>` tag in HTML?
✔✔The `<aside>` tag is used to define content that is related to the main content but could be
considered separate, like sidebars or additional information.
How can you hide an element using CSS?
✔✔You can hide an element using the `display: none;` or `visibility: hidden;` properties in CSS.
What attribute is used to specify the destination of a link in the `<a>` tag?
1
,✔✔The `href` attribute is used to specify the destination URL of a link in the `<a>` tag.
Which CSS property controls the text size?
✔✔The `font-size` property controls the text size in CSS.
What is a CSS preprocessor, and why is it used?
✔✔A CSS preprocessor, like SASS or LESS, allows for more complex stylesheets using
variables, nesting, and functions to streamline CSS writing.
How do you create a tooltip effect using HTML and CSS?
✔✔You can create a tooltip by using the `title` attribute on an element and styling it with CSS
using the `:hover` pseudo-class.
What does the `float` property do in CSS?
✔✔The `float` property is used to position an element to the left or right, allowing other content
to wrap around it.
What is the difference between `padding` and `margin` in CSS?
2
,✔✔`Padding` is the space between an element's content and its border, while `margin` is the
space outside an element's border, separating it from other elements.
How can you create a CSS class that applies styles only to specific devices?
✔✔You can use media queries in CSS to apply styles based on device characteristics, like
`@media (max-width: 600px) { /* styles */ }`.
What is the purpose of the `z-index` property in CSS?
✔✔The `z-index` property controls the stacking order of elements that overlap, determining
which one appears on top.
How can you include an external font in your web project?
✔✔You can include an external font using the `@import` rule or by adding a `<link>` tag in the
HTML `<head>` section pointing to a font service like Google Fonts.
What tag is used to define a block of text that is quoted from another source?
✔✔The `<blockquote>` tag is used to define a block of text that is quoted from another source.
How do you set a background image for a webpage using CSS?
3
, ✔✔You can set a background image using the `background-image` property, like `body {
background-image: url('image.jpg'); }`.
What is the purpose of the `clear` property in CSS?
✔✔The `clear` property is used to control the behavior of floating elements, ensuring that the
next element appears below the floated elements.
What HTML element is used to define a table header?
✔✔The `<th>` tag is used to define a header cell in a table.
How can you style an input field in a form using CSS?
✔✔You can style an input field by targeting it with its type, class, or ID, like `input[type="text"]
{ border: 1px solid #ccc; }`.
Why should the document type declaration be included in all HTML documents? ✔✔To specify
the HTML standard being used in the document.
Which of the following is the current HTML standard? ✔✔HTML5
4