The Developer Brains


HTML Style

Web Designing | Web Development


SEE MORE














</HTML Style >





Style

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



SEE MORE




















</Inline Style in HTML. >


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>
				
				
Try it Yourself

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>
				
				
Try it Yourself

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>

				
				
Try it Yourself

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

				
				
Try it Yourself

In style attribute ,you can apply any css property such as background,color,font,display,and more
click here to learn about css in detail

















Next: HTML Linking Resources


Previous

      

Next Page













  Share TDB SCHOOL  

Share this E-Learning Website on social media platforms with your friends and followers