start learning
Image 1
320210

HTML Elements

In HTML, an element is a fundamental building block used to create a web page. An element consists of a start tag, content, and an end tag. The start tag is enclosed in angle brackets and includes the name of the element, while the end tag has the same name preceded by a forward slash. The content is the text, images, and other elements that are contained within the element.

You can use our free live html editor to test tutorial codes .

Here are some examples of how to use HTML Element:

<p> Element

The <p> element is used to create a paragraph of text. It has a start tag <p> and an end tag </p>. For example :


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

<a> Element

The <a> element is used to create a hyperlink. It has a start tag <a> and an end tag </a>, and includes an attribute called href that specifies the URL of the link. For example :


     <a href="https://www.example.com">Click here to visit Example.com</a>

<img> Element

The <img> element is used to embed an image in a web page. It has a start tag <img> but no end tag. Instead, it includes an attribute called src that specifies the URL of the image. For example :


   <img src="https://www.example.com/images/example.jpg" alt="An example image">

<ul> and <li> Element

The <ul> and <li> elements are used to create an unordered list. The <ul> element has a start tag <ul> and an end tag </ul>, while each list item is created with the <li> element, which has a start tag <li> and an end tag </li>. For example :


<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>
  

<form> and <input> Element

The <form> element is used to create a form on a web page, while the <input> element is used to create various types of form controls, such as text boxes, radio buttons, and checkboxes. For example :


 <form action="submit-form.php" method="post">
  <label for="name">Name:</label>
  <input type="text" id="name" name="name"><br>
  <label for="email>>Email:</label>
  <input type="email" id="email" name="email"><br>
  <input type="submit" value="Submit">
</form>
  

A few examples of the many HTML elements available. It's important to use the appropriate elements for the content you're creating to ensure that your web page is structured correctly and can be easily understood by both humans and search engines.

×