HTML Styles

HTML Styles

HTML style attributes are used to change the appearance of elements. With the style attribute, you can add formatting such as colors, fonts, sizes, and more.


Example Code


 


Output Preview

This will appear like:

  • A blue-colored text

  • A larger font paragraph

  • A paragraph with yellow background


Common Style Properties

Property Description
color Changes text color
font-size Changes text size
background-color Adds background color
text-align Aligns text (left, center, right)
font-family Changes the font style

Another Example:


 


Using styles helps make web content more attractive and readable.

CodeCapsule

Sanjit Sinha — Web Developer | PHP • Laravel • CodeIgniter • MySQL • Bootstrap Founder, CodeCapsule — Student projects & practical coding guides. Email: info@codecapsule.in • Website: CodeCapsule.in

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *