HTML Elements.
HTML Elements
HTML elements are the building blocks of a web page. They represent different types of content, such as headings, paragraphs, links, images, and more.
Types of HTML Elements
- Headings:
<h1>
,<h2>
,<h3>
,<h4>
,<h5>
,<h6>
- Define headings and subheadings
- Paragraphs:
<p>
- Define a paragraph of text
- Links:
<a>
- Create hyperlinks to other web pages or email addresses
- Images:
<img>
- Add images to a web page
- Lists:
<ul>
,<ol>
,<li>
- Create unordered (bulleted) or ordered (numbered) lists
- Divisions:
<div>
- Group elements together for styling or layout purposes
- Spans:
<span>
- Apply styles or attributes to a section of text
HTML Element Structure
Most HTML elements follow this structure:
- Element: The name of the element (e.g.,
p
,a
,img
) - Attribute: Additional information about the element (e.g.,
href
,src
,alt
) - Value: The value of the attribute (e.g., a URL, an image file name)
- Content: The text or other elements inside the element
Example HTML Elements
- Heading:
<h1>Welcome to My Web Page</h1>
- Paragraph:
<p>This is a paragraph of text.</p>
- Link:
<a href="https://www.example.com">Visit Example.com</a>
- Image:
<img src="image.jpg" alt="An image on the page">
0 Comments