HTML Basics - The Web's Skeleton

HTML Basics - The Web's Skeleton

If you are beginner then this article is for you! In this article we will know about some basic concepts of html like what is HTML, why HTML, what is tags and elements, etc.

What is HTML?

HTML is stand for Hyper Text Transfer Protocol. HTML is basic language used to create the structure of web pages. and it’s standard markup language.

Example:

When you build a house, you first create the framework (walls, floors, roof). Similarly, HTML creates the basic structure of a website. Using some tags and elements. so HTML is very important in website

HTML Features:

  • HTML provides the structure of a webpage

  • HTML is simple and beginner-friendly.

  • All browsers can read and display HTML

  • HTML can work with CSS and JS

  • HTML is the foundation of all websites.

Example

<!DOCTYPE html>
<html>
    <head>
        <title>Page Title</title>
    </head>
    <body>
        <h1>My First Heading</h1>
        <p>My first paragraph.</p>
    </body>
</html>
  • <html> tag marks the start of an HTML document. Everything inside this tag is part of the HTML content.

  • <head> section contains meta-information about the webpage, like the title, which isn't displayed directly on the page.

  • <title> The title of the webpage that appears in the browser tab (not on the page itself). In this case, it's "Page Title."

  • <body> is where the actual content of the webpage goes, such as text, images, and links.


HTML Tags and Elements

HTML tags are the building blocks of an HTML document. They are used to define and organize the content of a webpage. Tags tell the browser how to display the text, images, and other elements on the page.

  1. HTML Headings

    → HTML Headings are defined with <h1>, <h2>, <h3>,<h4>,<h5>,<h6> tag.

    → This tags defines important of heading. <h1> defines the most important heading and <h6> defines the less important heading.

     <h1>This is heading 1</h1>
     <h2>This is heading 2</h2>
    
  2. HTML paragraph

    →HTML paragraphs are defined with the <p> tag.

     <p>This is paragraph<p>
    
  3. HTML Links

    → HTML links are defined with the <a> tag.

    → Link destination write in href attribute.

     <a href="https://www.chaicode.com">chaicode</a>
    

So there are so many other tags are available in HTML for different purpose.

HTML Elements

HTML Elements

  • HTML Element is everything from start to end means HTML Element consists of a start tag, content, and an end tag.

  • <tagname>content</tagname>

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

Nested Elements

  • Elements can be inside other elements is called Nested Element.

      <div>
          <h1>Title</h1>
          <p>Paragraph inside a div.</p>
      </div>
    

Empty HTML Elements

  • Empty HTML elements do not have closing tags or content inside them.

  • Example: <br>, <hr>, <img>,<input>, <meta>.

      <p>This is a <br> paragraph.</p>
    

By understanding the basics of tags, elements, and structure, you can create the foundation for any webpage. Start experimenting with HTML today to bring your ideas to life!