FOLLOW US ON TWITTER



FOLLOW US



img/blogimg/html5.jpg


@harish 789

Style


2021-11-17 15:53 · 4 min read

Style

The style attribute is used to add CSS styles to an element(Inline styling), such as background color, color, font, size, and more.

HTML Style Attribute

The style of an HTML element can be applied with the style attribute.

<tagname style="property:value;">...</tagname>

 

The property is a CSS property. The value is a CSS value.

Text Color

The CSS color property defines the color of text for an HTML element.

<body style="color: blue">
<p>This a paragraph tag</p>
</body

Example:

<h2 style="color:crimson">SET inline style to change color of this heading</h2>
<p style="color: blueviolet">SET inline style to change color of paragraph text</p>

 

 

Background Color

The CSS Background-color property defines the background color of an HTML element.

<body style="background-color: blue">
<p>This a paragraph tag</p>
</body>

Example:

<h2 style="background-color:crimson">SET inline style to change background color of this heading</h2>
<p style="background-color: blueviolet">SET inline style to change background color of paragraph text</p>

 

Text Size

The CSS font-size property defines the font-size of an Text.

<body style="font-size:23px">
<p>This a paragraph tag</p>
</body>

Example:

<p style="font-size:15px">Change font text to 15px</p>
<p style="font-size:20px">Change font text to 20px</p>
<p style="font-size:25px">Change font text to 25px</p>
<p style="font-size:30px">Change font text to 30px</p>

Change Text Alignment

The CSS text-align property defines the alignment of an Text.

<body style="text-align:center">
<p>This a paragraph tag</p>
</body>

Example:

<h2 style="text-align: right">Change text alignment to right</h2>
<h2 style="text-align: center">Change text alignment to center</h2>
<h2 style="text-align: left">Change text alignment to left</h2> <!-- left is by default-->
TAGS:






POST COMMENTS
No Comment

Please login to post comment




POPULAR POSTS

best free web hosting services...
what is new in miui 11?...
free website ssl security using cloudfla...
do you want to make money online?...
CSS3 @IMPORT RULES...
What is HTML Anchor Tag and Hyperlinks?...
How to host a web page in 10 minutes....
CSS3 RESPONSIVE UI...
Tables HTML...
CSS3 FUNCTIONS...
How to use CSS3 Overflow Property?...
CSS3 FILTERS...


RECENT COMMENTS

2022-03-05 11:05
By coder on XAMPP - MySQL shutdown unexpectedly | How to fix MySQL crash unexpectedly
2021-10-12 12:34
By abnongoke on do you want to make money online?
2021-10-12 12:34
By abnongoke on how to get a free website domain name?
2021-10-12 12:34
By solar panel for shed on what is new in miui 11?
2021-10-12 12:34
By solar panel for shed on best free web hosting services
2021-10-12 12:34
By amos tanui on free website ssl security using cloudflare


SOCIAL SHARE



FOLLOW US ON TWITTER



FOLLOW US ON FACEBOOK



FOLLOW US







Recent Blogs



Contact Us

Subscribe Our News-Letter



Kashipur, 244713
Uttarakhand, India



© www.prodevskill.com 2023. All Rights Reserved. Powered by Pro Developer