Scenario-Based Questions & Answers

1 min read

How would you create a responsive layout in HTML?
- Use
<meta name="viewport">
and CSS media queries. HTML5 semantic elements help structure.
- Use
How can you improve accessibility in an HTML document?
- Use semantic tags,
alt
text, ARIA attributes, proper heading structure, and labels for inputs.
- Use semantic tags,
How would you create a table with merged rows and columns?
- Use
rowspan
andcolspan
attributes in<td>
or<th>
.
- Use
How do you include an external CSS or JavaScript file in HTML?
- CSS:
<link rel="stylesheet" href="style.css">
JS:<script src="script.js"></script>
- CSS:
How do you optimize an HTML page for SEO?
- Use semantic tags, meaningful URLs,
<title>
, meta descriptions, proper heading levels, and alt attributes for images.
- Use semantic tags, meaningful URLs,
0
Subscribe to my newsletter
Read articles from Banashree Aribenchi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
