HTML & CSS Exam Questions Guide
HTML & CSS Exam Questions Guide
Block-level elements start on a new line and take up the full width available, examples include <div> and <p>. Inline-level elements do not start on a new line and only take as much width as necessary, examples include <span> and <a> .
Google's web fonts enhance web design by offering a wide variety of easily accessible fonts without the need to host them locally. They provide optimization for speed and performance across devices and support international characters, enhancing the visual appeal and accessibility of web pages .
A web designer might use an <iframe> tag to embed multimedia content like YouTube videos because it allows for the independent loading of dynamic content without affecting the main page's performance. It also enables isolation of embedded content for security reasons .
The 'type' attribute in an <ol> tag dictates the style of numbering used for the list items, such as numbers, lowercase letters, uppercase letters, and Roman numerals .
'Display: none' completely removes an element from the document layout, meaning it does not occupy any space. 'Visibility: hidden' makes the element invisible but preserves the space it occupies. 'Display: none' can improve rendering performance by reducing page complexity, while 'visibility: hidden' is useful when maintaining layout integrity without showing certain elements .
Setting 'text-decoration: none' is used to remove default styles such as underlines from text elements, particularly hyperlinks, in order to achieve a desired aesthetic or to conform to specific design guidelines .
The 'alt' attribute provides a text alternative for an image, which is crucial for accessibility. It ensures that users who cannot view the image, such as those using screen readers, can still understand its context and purpose .
Using semantic HTML5 tags is important for enhancing accessibility, search engine optimization, and overall understanding of web content structures by parsers and browsers. Common examples include <article>, <section>, <nav>, and <footer> .
The 'box-sizing: border-box' CSS property ensures that padding and border are included in an element's total width and height. This prevents elements from overflowing their containers and simplifies the design of responsive layouts .
The 'float: right' property in CSS moves an element to the right side of its containing element, allowing text and other elements to wrap around it. This is useful for positioning images and creating sidebars .