HTML Tags Bca
HTML Tags Bca
1. hr tag
The <hr> tag defines a thematic break in an HTML page, and is most often
displayed as a horizontal rule.
The <hr> element is used to separate content (or define a change) in an HTML
page:
The <hr> tag is an empty tag, which means that it has no end tag.
Code:
<h1>start heading</h1>
<p>paragraph.</p>
<hr>
<h2>yes, now we will use hr tag </h2>
<p>students, note down this tag in your notebook.</p>
<hr>
OUTPUT:
2. br tag
Code:
<p>This is<br>a paragraph<br>with line breaks.</p>
OUTPUT:
HTML Style
The HTML style attribute is used to add styles to an element, such as color, font,
size, and more.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
OUTPUT:
The CSS background-color property defines the background color for an HTML
element.
<body style="background-color:PURPLE;">
<h1> heading</h1>
<p> paragraph.</p>
</body>
OUTPUT:
<body>
<h1 style="background-color:PURPLE;">heading</h1>
<p style="background-color:tomato;">paragraph.</p>
</body>
OUTPUT:
Text Color
The CSS color property defines the text color for an HTML element:
<h1 style="color:blue;">heading</h1>
<p style="color:red;">paragraph.</p>
OUTPUT:
Fonts
The CSS font-family property defines the font to be used for an HTML element:
<h1 style="font-family:verdana;">heading</h1>
<p style="font-family:courier;">paragraph.</p>
OUTPUT:
Text Size
The CSS font-size property defines the text size for an HTML element:
Text Alignment
The CSS text-align property defines the horizontal text alignment for an HTML
element:
<h1 style="text-align:center;">Heading</h1>
<p style="text-align:center;">paragraph.</p>
OUTPUT:
Summary
Use the style attribute for styling HTML elements
Use background-color for background color
Use color for text colors
Use font-family for text fonts
Use font-size for text sizes
Use text-align for text alignment