HTML Elements -Learn HTML Element With Example

HTML (Hypertext Markup Language) is the standard markup language used to create the structure and content of web pages. HTML elements are the building blocks of HTML documents. They define the structure and semantic meaning of different parts of a web page.


Here are some commonly used HTML elements:


1. `<html>`: Represents the root element of an HTML document.

2. `<head>`: Contains metadata about the document, such as the page title and linked stylesheets.

3. `<title>`: Defines the title of the document, displayed in the browser's title bar or tab.

4. `<body>`: Contains the visible content of the web page.

5. `<h1>` to `<h6>`: Headings of different levels, with `<h1>` being the highest and `<h6>` being the lowest.

6. `<p>`: Represents a paragraph of text.

7. `<a>`: Creates a hyperlink to another web page or a specific location within the same page.

8. `<img>`: Inserts an image into the web page.

9. `<div>`: Defines a division or a container for other HTML elements.

10. `<ul>` and `<li>`: Create an unordered (bulleted) list of items.

11. `<ol>` and `<li>`: Create an ordered (numbered) list of items.

12. `<table>`, `<tr>`, `<th>`, and `<td>`: Define and structure tabular data.

13. `<form>`: Represents an interactive form for user input.

14. `<input>`: Creates an input field within a form.

15. `<button>`: Creates a clickable button.


To use these HTML elements, you need to understand the basic syntax of HTML. Here's an example of how to use some of these elements:


```html

<!DOCTYPE html>

<html>

<head>

  <title>My Web Page</title>

</head>

<body>

  <h1>Welcome to My Web Page</h1>

  

  <p>This is a paragraph of text.</p>

  

  <a href="https://www.example.com">Visit Example</a>

  

  <img src="image.jpg" alt="My Image">

  

  <ul>

    <li>Item 1</li>

    <li>Item 2</li>

    <li>Item 3</li>

  </ul>

  

  <form>

    <label for="name">Name:</label>

    <input type="text" id="name" name="name">

    <button type="submit">Submit</button>

  </form>

</body>

</html>

```


This is just a basic overview of HTML elements. There are many more elements and attributes available for different purposes. You can learn more about HTML by referring to online tutorials, resources, or documentation.


Post a Comment

Previous Post Next Post