0% found this document useful (0 votes)
36 views5 pages

HTML Tags Bca

The document discusses various HTML tags and CSS properties for styling elements. It explains that the <hr> tag defines a thematic break, the <br> tag inserts a line break within a paragraph, and the style attribute is used to style elements with properties like color, font, size, and background-color. It provides examples of using these tags and properties to change text colors, fonts, sizes, alignment, and set background colors.

Uploaded by

ÂJÂY DHYÂNI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views5 pages

HTML Tags Bca

The document discusses various HTML tags and CSS properties for styling elements. It explains that the <hr> tag defines a thematic break, the <br> tag inserts a line break within a paragraph, and the style attribute is used to style elements with properties like color, font, size, and background-color. It provides examples of using these tags and properties to change text colors, fonts, sizes, alignment, and set background colors.

Uploaded by

ÂJÂY DHYÂNI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

HTML Horizontal

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

The HTML <br> element defines a line break.


Use <br> if you want a line break (a new line) without starting a new paragraph:
The <br> tag is an empty tag, which means that it has no end 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>

<p>donot create noise</p>


<p style="color:red;">change the color</p>
<p style="color:blue;">again, change</p>
<p style="font-size:50px;">now see font size</p>

</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:

Set background color for two different elements:

<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:

<h1 style="font-size:300%;">This is a heading</h1>


<p style="font-size:160%;">This is a paragraph.</p>
OUTPUT:

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

You might also like