What does HTML stand for?
Answer: HyperText Markup Language
Which tag is used to create a hyperlink in HTML?
Answer: <a>
What is the purpose of the <title>
tag in an HTML document?
Answer: It specifies the title of the web page, which appears in the browser’s title bar or tab.
Which tag is used to create a paragraph in HTML?
Answer: <p>
What is the correct syntax for adding an image in HTML?
Answer: <img src="image.jpg" alt="description">
How do you create an ordered list in HTML?
Answer: Use the <ol>
tag with <li>
tags for each list item.
Which tag is used to create a table row in HTML?
Answer: <tr>
What is the purpose of the <meta>
tag in HTML?
Answer: It provides metadata about the HTML document, such as character encoding and viewport settings.
How do you create a line break in HTML?
Answer: Use the <br>
tag.
Which attribute is used to specify the URL of a link in the <a>
tag?
Answer: href
What is the difference between <ul>
and <ol>
tags?
Answer: <ul>
creates an unordered list (bullets), while <ol>
creates an ordered list (numbers).
Which tag is used to define a heading in HTML?
Answer: <h1>
to <h6>
How do you specify the language of an HTML document?
Answer: Use the lang
attribute in the <html>
tag. Example: <html lang="en">
What is the purpose of the alt
attribute in the <img>
tag?
Answer: It provides alternative text for the image if it cannot be displayed.
What is the purpose of the <head>
section in an HTML document?
Answer: It contains metadata, links to stylesheets, and scripts.
Which tag is used to create a horizontal line in HTML?
Answer: <hr>
How do you create a comment in HTML?
Answer: <!-- This is a comment -->
What is the purpose of the viewport
meta tag?
Answer: It ensures the web page is responsive and adapts to different screen sizes.
How do you create ordered and unordered lists in HTML? Explain with examples.