HTML INTERVIEW QUESTIONS
HTML INTERVIEW QUESTIONS
1. Basics of HTML
o HTML is forgiving of errors (e.g., missing tags), while XHTML is stricter and follows
XML rules (e.g., every tag must be properly closed).
o It informs the browser about the version of HTML being used to ensure proper
rendering.
o Block-level elements (e.g., <div>, <p>) take up the full width and start on a new line.
Inline elements (e.g., <span>, <a>) only take up as much width as necessary and do
not break the line.
o Void elements are self-closing tags without content, like <img>, <input>, <br>.
7. <!DOCTYPE html>
8. <html lang="en">
9. <head>
12. </head>
13. <body>
14. <h1>Welcome!</h1>
15. </body>
16. </html>
o Specifies the document's language for accessibility and SEO (e.g., <html lang="en">).
o <strong> indicates importance semantically, while <b> just makes text bold visually.
o Absolute URLs include the full web address (e.g., https://example.com/page), while
relative URLs depend on the current directory (e.g., page.html).
o Provides additional information as a tooltip when the mouse hovers over the link.
20. </form>
21. What are the differences between GET and POST methods in forms?
o GET: Sends data in the URL query string, used for non-sensitive data.
o POST: Sends data in the HTTP body, suitable for sensitive data.
5. Tables
22. <table>
23. <tr>
26. </tr>
27. <tr>
30. </tr>
31. </table>
6. Media Elements
26. How do you embed an image in HTML?
32. </audio>
36. </video>
7. HTML5 Features
8. Accessibility
o Helps screen readers and search engines understand the document structure.
50. What is the difference between inline, internal, and external CSS?
o Inline: Directly within elements; Internal: Within <style>; External: Separate file.
o Holds reusable HTML fragments that are hidden until injected with JavaScript.