HTML Body Tag | Heading Tag |

tag

 

1.2.4 Body Tag

The <body> tag is used to define the visible content of the webpage. Everything that is displayed on the web page, such as text, images, links, tables, and forms, goes inside the <body> tag.

Example:

<body>
    <h1>Welcome to My Website</h1>
    <p>This is the main content of the page.</p>
</body>

Everything inside the <body> tag is visible to the user when they open the webpage in a browser.


1.2.5 Heading Tags

HTML provides six levels of headings, from <h1> (the largest) to <h6> (the smallest). These tags are used to structure the content hierarchically and make it more readable for users and search engines.

Example:

<h1>This is a Heading 1</h1>
<h2>This is a Heading 2</h2>
<h3>This is a Heading 3</h3>
<h4>This is a Heading 4</h4>
<h5>This is a Heading 5</h5>
<h6>This is a Heading 6</h6>
  • <h1> is typically used for the main title of the page.
  • <h2> to <h6> are used for subheadings, with <h2> being a second-level heading, <h3> a third-level heading, and so on.

1.2.6 <p> Tag

The <p> tag is used to define a paragraph. It is one of the most basic and commonly used tags in HTML.

Example:

<p>This is a paragraph of text. Paragraphs are typically used to group related sentences together.</p>
  • The <p> tag automatically adds space before and after the text, creating a visual separation between paragraphs.

1.2.7 HTML Style

The <style> tag is used to define CSS styles directly within an HTML document. You can add styles for elements like text color, font size, background color, etc.

Example of using the <style> tag within the <head> section:

<!DOCTYPE html>
<html>
    <head>
        <title>Styled Webpage</title>
        <style>
            body {
                background-color: lightblue;
            }
            h1 {
                color: darkblue;
            }
            p {
                font-size: 18px;
            }
        </style>
    </head>
    <body>
        <h1>Welcome to My Styled Webpage</h1>
        <p>This page has a light blue background and styled text.</p>
    </body>
</html>

In this example:

  • The <style> tag is used to define CSS styles.
  • body { background-color: lightblue; } changes the background color of the page.
  • h1 { color: darkblue; } changes the color of the heading text.
  • p { font-size: 18px; } adjusts the font size of the paragraph.


Comments

Popular posts from this blog

Introduction to Computer

History of Computer

Computer Generation