DEV Community

Cover image for HTML Tags
Mahalakshmi C
Mahalakshmi C

Posted on

HTML Tags

What is HTML?
HTML stand as HyperText Markup Language, is the standard markup language used to create and structure the content of a web page.

What is HTML Tag?
HTML uses tags to create the structure of a web page. Tags are enclosed in angle brackets (< >).

DOCTYPE HTML
<!DOCTYPE html> tells the browser that the document is written in HTML5. It should always be the first line of an HTML document.

HTML Tag
The <html> Tag is the root element of an HTML document.

Head Part

  • The <head> Tag contains information about the webpage, such as the title, CSS links, meta tags, and scripts. It is not displayed on the webpage.

  • The <title> tag sets the title of the webpage, which appears on the browser tab.

  • The <meta> tag provides additional information (metadata) about the webpage, such as character encoding and responsive viewport settings.

  • The <style> tag is used to write Internal CSS to style HTML elements.

Body Part

  • The <body> tag contains all the visible content of the webpage, such as headings, paragraphs, images, buttons, forms, and links.

  • The Heading tags are used to create headings.<h1> is the largest heading, and <h6> is the smallest.

  • The <p> tag is used to create a paragraph.

  • The <a> Anchor tag is used to create a hyperlink, allowing users to navigate to another webpage or website.

  • The <img> tag displays an image on the webpage.

  • The <div> tag is a block-level container used to group multiple HTML elements together for styling and layout.

  • The <span> tag is an inline container used to style or highlight a small part of the text.

  • The <br> tag inserts a line break, moving the next content to a new line.

  • The <hr> tag creates a horizontal line to separate sections of content.

  • The <button> tag creates a clickable button.

  • The <input> tag creates an input field where users can enter data.

<!DOCTYPE html>
<html>

<head>
    <title>Basic HTML Example</title>
</head>

<body>

    <!-- Div Tag -->
    <div>

        <!-- Heading Tag -->
        <h1>Welcome to My Website</h1>

        <!-- Paragraph Tag -->
        <p>This is a simple HTML page created using basic HTML tags.</p>

        <!-- Image Tag -->
        <img src="profile.jpg" alt="Profile Image" width="200">

        <br><br>

        <!-- Anchor Tag -->
        <a href="https://www.google.com">Visit Google</a>

        <br><br>

        <!-- Input Tag -->
        <input type="text" placeholder="Enter your name">

        <br><br>

        <!-- Button Tag -->
        <button>Submit</button>

    </div>

</body>

</html>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)