KEMBAR78
HTML Interview Review | PDF
0% found this document useful (0 votes)
8 views2 pages

HTML Interview Review

The document provides a quick review of HTML basics, including common tags, attributes, forms, and semantic HTML. It also distinguishes between block and inline elements and lists common interview questions related to HTML. Key concepts include the Document Object Model (DOM), differences between id and class, and accessibility practices.

Uploaded by

xaviernive
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

HTML Interview Review

The document provides a quick review of HTML basics, including common tags, attributes, forms, and semantic HTML. It also distinguishes between block and inline elements and lists common interview questions related to HTML. Key concepts include the Document Object Model (DOM), differences between id and class, and accessibility practices.

Uploaded by

xaviernive
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

HTML Quick Interview Review

HTML Basics

- HTML (HyperText Markup Language) structures web content.


- Uses tags: <tagname>content</tagname>
- Example:
<!DOCTYPE html>
<html>
<head><title>Title</title></head>
<body><h1>Hello</h1></body>
</html>

Common Tags

<h1> to <h6> - Headings


<p> - Paragraph
<a href=""> - Link
<img src=""> - Image
<ul>, <ol>, <li> - Lists
<div> - Block container
<span> - Inline container
<br> - Line break
<form>, <input>, <label>, <button> - Form elements

Attributes

Used inside tags to add functionality:


- href, src, alt, id, class, style, title
Example: <img src="logo.png" alt="Logo" width="100">

Forms

<form action="/submit" method="POST">


<label for="email">Email:</label>
<input type="email" id="email" name="email" required />
<button type="submit">Submit</button>
</form>
- 'action' is the URL to send form data.
- 'method' is usually GET or POST.
- Use 'label' with 'for' matching input 'id' for accessibility.

Semantic HTML

Semantic elements provide meaning to content:


<header>, <nav>, <main>, <section>, <article>, <aside>, <footer>, <figure>, <figcaption>
- Helps with SEO and screen readers.
HTML Quick Interview Review

Block vs Inline Elements

Block Elements: Take full width (e.g., <div>, <p>, <h1>, <ul>)
Inline Elements: Stay in line with text (e.g., <span>, <a>, <img>)

Common Interview Questions

1. Difference between HTML and XHTML?


- XHTML is stricter and XML-based; HTML5 is more flexible.

2. What are void elements?


- Elements that do not have a closing tag (e.g., <img>, <br>, <input>).

3. What is the DOM?


- Document Object Model: browser's representation of the page structure.

4. What is the difference between id and class?


- 'id' is unique per page; 'class' can be reused for multiple elements.

5. What are some accessibility practices?


- Use semantic elements, <label> for inputs, 'alt' attributes on images, ARIA roles where needed.

You might also like