HTML Page Structure

M2-R5.1 · Chapter 3: HTML Basics · 3 min read

PAGE STRUCTURE AND TAGS USED IN HTML

HTML में चार मुख्य tags होते हैं:

<HTML>, <Head>, <Title>, <Body>

  • <HTML> → यह document को एक HTML document के रूप में specify करता है।
  • <Body> → यह HTML document का main tag है।
  • <Head> → इस tag में document से संबंधित information होती है, जैसे title, script, stylesheet, meta information आदि।
  • <Title> → इस tag में document का title होता है।
    • <title> tag के अंदर लिखा हुआ text, webpage open होने पर browser की title bar में दिखाई देता है।
  • <body> tag में वे सभी tags, attributes और information शामिल होती हैं जिन्हें webpage पर display करना होता है।
  • यह HTML document का सबसे बड़ा भाग होता है।

ATTRIBUTES OF <BODY> TAG

AttributeDescription
bgcolorयह specified color के अनुसार default background color को बदलता है।
Example: <body bgcolor="skyblue">
textयह body के text color को specified color में बदलता है।
Example: <body text="red">
backgroundयह उस image का name specify करता है जिसे document के background के रूप में use किया जाएगा।
Example: <body background="sample.jpg">

HEADING TAGS

  • HTML में <h1> से <h6> तक headings के 6 levels होते हैं।
  • <h1> सबसे बड़ी heading होती है और <h6> सबसे छोटी heading होती है।

Syntax:

<h1>Heading 1</h1>

<h2>Heading 2</h2>

<h3>Heading 3</h3>

<h4>Heading 4</h4>

<h5>Heading 5</h5>

<h6>Heading 6</h6>

BREAK TAG (<br>)

  • Tag: <br>
  • इसका उपयोग तब किया जाता है जब text को नई line से शुरू करना हो और उसी line में continue नहीं करना हो।
  • Blank line छोड़ने के बजाय हम break tag का उपयोग कर सकते हैं।

DRAWING LINE (HORIZONTAL RULE)

  • Tag: <hr>
  • इसका उपयोग HTML में एक horizontal line create करने के लिए किया जाता है।

Attributes of <hr>

AttributeDescriptionExample
colorयह line के color को बदलता है।<hr color="red">
widthयह line की width set करता है।<hr width="60%">
alignयह line को left, right या center में align करता है।<hr align="left">
sizeयह line की thickness को बदलता है।<hr size="5">

PARAGRAPH TAG

  • Tag: <p>
  • इस tag का उपयोग एक paragraph को break करके नया paragraph create करने के लिए किया जाता है।

Syntax:

<p>Paragraph content</p>

ALIGN ATTRIBUTE IN PARAGRAPH

  • align attribute का उपयोग document में paragraph को left, center या right में align करने के लिए किया जाता है।

Example:

<p align="right">This paragraph is aligned to the right.</p>