HTML elements

HTML provides a wide range of elements that you can use to structure and organize the content of your webpages. Here are some commonly used HTML elements:


1. Headings: Used to define different levels of headings, from `<h1>` (the highest level) to `<h6>` (the lowest level). For example:
html
<h1>This is a Heading 1</h1>
<h2>This is a Heading 2</h2>
<h3>This is a Heading 3</h3>


2. Paragraph: Used to define paragraphs of text. For example:
html
<p>This is a paragraph of text.</p>


3. Links: Used to create hyperlinks to other webpages or resources. For example:
html
<a href="https://example.com">Visit Example.com</a>


4. Images: Used to display images on a webpage. For example:
html
<img src="image.jpg" alt="Description of the image">


5. Lists: Used to create ordered or unordered lists. For example:
html
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>

<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>


6. Tables: Used to create tabular data. For example:
html
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>


7. Forms: Used to create interactive forms for user input. For example:
html
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>


8. Divisions: Used as a container to group and style other elements. For example:
html
<div>
<p>This is some text inside a div.</p>
<img src="image.jpg" alt="Image inside a div">
</div>


9. Span: Used to apply styles or mark specific parts of a text. It is an inline element. For example:
html
<p>This is a <span style="color: blue;">blue</span> text.</p>


10. Semantic Elements: HTML5 introduced semantic elements that give meaning to the structure of a webpage. These include `<header>`, `<nav>`, `<section>`, `<article>`, `<footer>`, and more. For example:
html
<header>
<h1>Website Header</h1>
</header>

<section>
<h2>About Us</h2>
<p>Some content about the company.</p>
</section>

<footer>
<p>&copy; 2023 My Website. All rights reserved.</p>
</footer>


These are just a few examples of HTML elements. There are many more elements available, each serving a specific purpose and providing different functionalities. By combining and nesting these elements, you can structure and present your content effectively on the web.



About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext