HTML (HyperText Markup Language) is the standard language used to structure content on the web. It tells the browser how to display text, images, and other elements on a webpage.
- HTML is a markup language, not a programming language.
- It defines the structure of a webpage using tags and elements.
- HTML is static; CSS styles it and JavaScript adds interactivity.
- It forms the foundation of almost every website today.
Beginner HTML Questions
Here are some beginner-friendly HTML questions to help you get started.
1. What are HTML tags?
HTML tags are special keywords enclosed in angle brackets (< >) that tell a web browser how to structure and display content on a webpage.
<h1>Hello!h1>
<p>A **paragraph** goes here.p>
2. What’s the difference between HTML and HTML5?
HTML is the general name for HyperText Markup Language, and HTML5 is the latest launched version in 2014. HTML5 added awesome features like:
| Aspect | HTML | HTML5 |
|---|---|---|
| Doctype | Long & complex | Simple: |
| Multimedia | Needs plugins (Flash) | , |
| Graphics | No native support | , |
| Forms | Basic inputs | New inputs: email, date, etc. |
| Semantic Tags | Uses | , , |
| APIs | None | Geolocation, Web Storage, etc |
3. What’s the basic structure of an HTML document?
Every HTML document needs a specific setup so browsers know how to read it. It’s like the blueprint for your web page. Here’s what goes in it:
: Tells the browser this is an HTML5 page.: The main container for everything else.: Holds behind-the-scenes info like the page title or links to CSS and JavaScript.: Where all the visible stuff goes, like text, images, or links.
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My Cool **Website**title>
head>
<body>
<h1>Hey There!h1>
<p>Welcome to my **page**.p>
body>
html>
4. What’s the difference between a tag and an element?
A tag is just the code you write, like or , are self-closing and don’t need a closing partner. So, tags are the tools, and elements are what you build with them.
- Tag: or, just the code.
- Element: Hi there!, the tag plus content.
This is an **element**.
5. What are attributes in HTML?
Attributes are extra details you add to an opening tag to give it more powers. They look like name="value". For example, they can tell a link where to go or an image what picture to show. Common ones are href for links, src for images, and id to give something a unique name.
<a href="https://example.com/">Click this **link**a>
<img src="pic.jpg" alt="A cool photo">
6. What is the difference between , , and ? is a generic container for styling or layout, groups thematically related content, and represents self-contained, independent content like blog posts or news items.Generic container, no semantic meaning. Groups related content thematically. Self-contained content that stands independently. Used for grouping elements. Usually includes a heading (–). Suitable for blog posts, news articles, comments. Mainly for styling or layout purposes. Helps structure content logically on the page. Can be reused or syndicated. Example: Styled content box
Example: Services
Web development and design
Example: Blog Post
This is a blog article
7. How do you create hyperlinks? What are absolute vs relative URLs?
A hyperlink is created using the (anchor) tag and an href attribute that says where the link goes. The text inside the tag is what people click on to visit another page or resource.
Go to Example
This makes a clickable link that says “Go to Example” and takes you to that website.
Absolute URL: An absolute URL specifies the full path to the resource, including the protocol (http, https, etc.), domain, and file path. It works independently of the current page location.
About Us- No matter where the current page is hosted, this link always points to the full domain.
Relative URL: A relative URL specifies the path to the resource relative to the current page’s location. It is used when linking to resources within the same website/project.
About Us- If the current website is hosted at https://www.mysite.com, this link points to https://www.mysite.com/about.html.
8. What’s the
tag for?
The
tag puts pictures on your web page. It’s a self-closing tag, so it doesn’t need a closing part. You need two main attributes:
src: Tells the browser where to find the image file.alt: Gives a description of the image for accessibility (like for people using screen readers) or if the image doesn’t load.
The alt text also helps Google understand your image, which is great for SEO.

9. What’s the difference between block-level and inline elements?
Block-level and inline elements act differently on a web page:
- Block-level elements: Take up the whole width of their space, start on a new line, and stack like boxes (e.g., ,
,
). They’re great for big sections like paragraphs or headers.
- Inline elements: Only use the space their content needs, stay on the same line, and flow with text (e.g., , ,
). They’re perfect for small bits like links or images within a sentence.
HTML
<div>This **block** starts a new line.div>
<div>Another **block**.div>
<span>This **inline** stays herespan> <span>and so does this.span>
10. What kinds of lists can you make in HTML?
HTML lets you create three types of lists:
- Ordered List (
):
Shows items with numbers or letters (like 1, 2, 3). - Unordered List (
):
Uses bullets for items. - Description List (
):
Pairs terms (- ) with their descriptions (
- ).
For ordered and unordered lists, each item goes in an - (list item) tag.
HTML
<ol>
<li>First **item**li>
<li>Second **item**li>
ol>
<ul>
<li>**Bullet** pointli>
<li>Another **point**li>
ul>
<dl>
<dt>**HTML**dt>
<dd>**HyperText Markup Language**dd>
dl>
11. What is the
The tag in HTML is used to create a form that collects user input and sends it to a server for processing. It acts as a container for input elements like text boxes, checkboxes, radio buttons, and buttons.
action attribute: Defines where the form data should be sent once the user submits it.
- Example: action="/submit.php" will send the form data to the submit.php file on the server.
method attribute: Defines how the form data will be sent to the server.
- GET: Appends the form data into the URL (visible in the address bar, suitable for non-sensitive data, like search queries).
- POST: Sends data in the request body (not visible in the URL, better for sensitive or large data like passwords and file uploads).
HTML
<form action="/submit" method="post">
<label for="name">**Name**:label>
<input type="text" id="name" name="name">
<input type="submit" value="**Send**">
form>
This form asks for a name and sends it to /submit.
12. What does the
tag do and when should you avoid it?
The
tag adds a line break, moving content to the next line without starting a new paragraph.
- It’s self-closing and handy for things like addresses or poems where you want a quick line shift without extra space.
- It should not be used for layout or spacing. Instead, use semantic HTML and CSS for better readability and maintainability.
123 **Main St**
**New York**, NY13. How do you make a link open in a new tab safely?
To make a hyperlink open in a new tab, add target="_blank" to the tag. This keeps the current page open while the new page loads in a separate tab. Adding rel="noopener" is a good idea for security, so the new tab can’t mess with your original page.
Open in a **New Tab**- Using target="_blank" alone exposes a security risk: the new page can access the window.opener property and potentially manipulate the original page (phishing or malicious redirects).
- We add rel="noopener" to prevent the new page from accessing window.opener
14. What does the tag do and why is it important for SEO?
The tag sets the name of your web page that appears in the browser tab and helps people and search engines know what your page is about.
- Helps Search Engines: Makes it easier for Google and others to understand your page.
- Helps Visitors: Lets people quickly see what your page is about, so they know if they want to click.
My Awesome **Website** 15. What’s the tag?
The tag lives in the and gives extra info about your web page, like what character set it uses, a description for search engines, or settings for mobile screens. It’s not visible to users but helps browsers and Google understand your page better.
- Charset (): Defines the character encoding of the web page. UTF-8 is the most widely used because it supports almost all characters and symbols across different languages.
- Viewport: It helps control how a page is displayed on mobile and tablet devices. Ensures the website is responsive by setting the width of the page equal to the device’s screen width.
- Description: It provides a short summary of the web page’s content. This description often appears in search engine results (SEO).
16. How do you make a table?
A table is built with the
Styled content box Web development and design This is a blog article A hyperlink is created using the (anchor) tag and an href attribute that says where the link goes. The text inside the tag is what people click on to visit another page or resource. This makes a clickable link that says “Go to Example” and takes you to that website. Absolute URL: An absolute URL specifies the full path to the resource, including the protocol (http, https, etc.), domain, and file path. It works independently of the current page location. Relative URL: A relative URL specifies the path to the resource relative to the current page’s location. It is used when linking to resources within the same website/project. The The alt text also helps Google understand your image, which is great for SEO. Block-level and inline elements act differently on a web page: , HTML lets you create three types of lists: For ordered and unordered lists, each item goes in an The tag in HTML is used to create a form that collects user input and sends it to a server for processing. It acts as a container for input elements like text boxes, checkboxes, radio buttons, and buttons. action attribute: Defines where the form data should be sent once the user submits it. method attribute: Defines how the form data will be sent to the server. This form asks for a name and sends it to /submit. The To make a hyperlink open in a new tab, add target="_blank" to the tag. This keeps the current page open while the new page loads in a separate tab. Adding rel="noopener" is a good idea for security, so the new tab can’t mess with your original page. The The tag lives in the and gives extra info about your web page, like what character set it uses, a description for search engines, or settings for mobile screens. It’s not visible to users but helps browsers and Google understand your page better. A table is built with the Generic container, no semantic meaning. Groups related content thematically. Self-contained content that stands independently. Used for grouping elements. Usually includes a heading ( –).Suitable for blog posts, news articles, comments. Mainly for styling or layout purposes. Helps structure content logically on the page. Can be reused or syndicated. Example: Example: Services
Example: Blog Post
7. How do you create hyperlinks? What are absolute vs relative URLs?
Go to ExampleAbout UsAbout Us8. What’s the
tag for?
tag puts pictures on your web page. It’s a self-closing tag, so it doesn’t need a closing part. You need two main attributes:
src: Tells the browser where to find the image file.alt: Gives a description of the image for accessibility (like for people using screen readers) or if the image doesn’t load.
9. What’s the difference between block-level and inline elements?
). They’re great for big sections like paragraphs or headers.
). They’re perfect for small bits like links or images within a sentence.
<div>This **block** starts a new line.div>
<div>Another **block**.div>
<span>This **inline** stays herespan> <span>and so does this.span>
10. What kinds of lists can you make in HTML?
):
Shows items with numbers or letters (like 1, 2, 3).):
Uses bullets for items.):
Pairs terms (<ol>
<li>First **item**li>
<li>Second **item**li>
ol>
<ul>
<li>**Bullet** pointli>
<li>Another **point**li>
ul>
<dl>
<dt>**HTML**dt>
<dd>**HyperText Markup Language**dd>
dl>
11. What is the
<form action="/submit" method="post">
<label for="name">**Name**:label>
<input type="text" id="name" name="name">
<input type="submit" value="**Send**">
form>
12. What does the
tag do and when should you avoid it?
tag adds a line break, moving content to the next line without starting a new paragraph. 123 **Main St**
**New York**, NY13. How do you make a link open in a new tab safely?
Open in a **New Tab**14. What does the
15. What’s the tag?
16. How do you make a table?



