1. What is HTML?
HTML stands for HyperText Markup Language. It is the standard language used to create the structure of web pages. It uses tags to define elements like headings, paragraphs, links, and images. code HTML <!DOCTYPE html> <html> <head> <title>My Page</title> </head> <body> <h1>Hello World</h1> </body> </html>
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
2. What is the difference between HTML and HTML5?
HTML5 is the latest version of HTML. It includes new features like native video/audio support ( <video> , <audio> ), drawing ( <canvas> ), and better structure with semantic tags ( <header> , <footer> , <section> ). HTML HTML were mainly used to display and arrange elements like text, pictures, hyperlinks, tables, and forms on websites. code HTML <video>...</video>
<video>...</video>
3. What are HTML tags?
Tags are used to mark the beginning and end of an element. They are enclosed in angle brackets. Example: <p>This is a interview hub.</p> code HTML <p>This is a interview hub.</p>
<p>This is a interview hub.</p>
4. What is an attribute in HTML?
Attributes provide additional information about an element. They are always specified in the start tag. Example: <img src='image.jpg' alt='Description'> code HTML <img src='image.jpg' alt='Description'>
<img src='image.jpg' alt='Description'>
5. What is the difference between block-level and inline elements?
Block-level elements always start on a new line and take up the full width available (e.g., <div> , <p> , <h1> ). Inline elements do not start on a new line and only take as much width as necessary (e.g., <span> , <a> , <img> ). code HTML <div>...</div>
<div>...</div>