HTML Basic Examples

      Comments Off on HTML Basic Examples
Spread the love

HTML (Hypertext Markup Language) is a markup language used for creating web pages. It provides the structure and content of a webpage, and is essential to creating websites. In this article, we’ll discuss some basic HTML examples that every beginner should know.

  1. Creating Headings Headings are used to structure content on a webpage. HTML provides six levels of headings, ranging from H1 to H6. The H1 tag denotes the main heading of the webpage, while H2 to H6 denote subheadings. Here’s an example:
css
<h1>This is a Heading</h1>
<h2>This is a Subheading</h2>
  1. Creating Paragraphs Paragraphs are used to display text content on a webpage. They are denoted by the <p> tag. Here’s an example:
css
<p>This is a paragraph of text.</p>
  1. Creating Lists HTML provides two types of lists: ordered and unordered. Ordered lists are denoted by the <ol> tag, and unordered lists are denoted by the <ul> tag. Each item in the list is denoted by the <li> tag. Here’s an example:
css
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>
  1. Creating Links Links are used to navigate between web pages or to specific sections on a webpage. They are denoted by the <a> tag, and the href attribute is used to specify the URL of the link. Here’s an example:
less
<a href="https://www.example.com">Click here to visit Example.com</a>
  1. Adding Images Images are used to display visual content on a webpage. They are denoted by the <img> tag, and the src attribute is used to specify the URL of the image. Here’s an example:
css
<img src="https://www.example.com/image.jpg" alt="Description of the image">

In conclusion, these are some basic HTML examples that every beginner should know. By mastering these examples, you can create simple web pages with ease. However, HTML provides a wide range of tags and attributes, and there are many more advanced examples to explore. Happy coding!