Recall & Review
beginner
What happens if you forget to include the
<!DOCTYPE html> declaration at the top of your HTML file?The browser may enter quirks mode, causing inconsistent rendering and unexpected layout issues. Always include
<!DOCTYPE html> to ensure standards mode.Click to reveal answer
beginner
Why should you avoid using deprecated tags like
<center> or <font> in HTML?Deprecated tags are outdated and not supported in modern HTML. They reduce accessibility and make your code harder to maintain. Use CSS for styling and layout instead.
Click to reveal answer
intermediate
What is a common mistake when nesting HTML elements?
Placing block-level elements inside inline elements (like putting a
<div> inside a <span>) is invalid and can break layout or cause unexpected behavior.Click to reveal answer
beginner
Why is it important to always close your HTML tags properly?
Unclosed tags can cause browsers to guess the structure, leading to broken layouts and accessibility problems. Always close tags like
<p>, <li>, and others.Click to reveal answer
beginner
What mistake do developers often make with
alt attributes on images?Leaving the
alt attribute empty or missing reduces accessibility for users with screen readers. Always provide meaningful alt text describing the image content.Click to reveal answer
Which of the following is the correct way to start an HTML5 document?
✗ Incorrect
The correct declaration to start an HTML5 document is
<!DOCTYPE html>. It tells the browser to use standards mode.What is wrong with this HTML snippet?
<span><div>Content</div></span>✗ Incorrect
Block-level elements like
div should not be placed inside inline elements like span. This breaks HTML rules.Why should you avoid using inline styles like
style="color:red;" directly in HTML?✗ Incorrect
Using inline styles mixes content and design, which makes your code harder to maintain and less reusable. Use CSS files instead.
What is the purpose of the
alt attribute in an <img> tag?✗ Incorrect
The
alt attribute provides descriptive text for screen readers and displays if the image cannot load, improving accessibility.Which tag is used to create a clickable link in HTML?
✗ Incorrect
The
<a> tag creates clickable links. The href attribute inside it specifies the link destination.List three common mistakes beginners make when writing HTML and explain why they cause problems.
Think about how browsers read HTML and how accessibility is affected.
You got /5 concepts.
Explain why semantic HTML and accessibility attributes are important in web development.
Consider users with disabilities and search engines.
You got /4 concepts.