The style attribute is used to give style to HTML web pages.
<tagname style="property:value;">
Background Color: background-colour defines the background colour of the web page in the HTML
Example:
<body style="background-color:blue;"> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body>
Text Color: CSS color property is used to define text color in HTML.
Example:
<h1 style="color:blue;">This is a heading</h1> <p style="color:red;">This is a paragraph.</p>
Fonts: The CSS font-family property defines the font to be used for an HTML element
<h1 style="font-family:verdana;">This is a heading</h1> <p style="font-family:courier;">This is a paragraph.</p>
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>
Text Alignment:
The CSS text-align property defines the horizontal text alignment in HTML.
<h1 style="text-align:center;">Centered Heading</h1> <p style="text-align:center;">Centered paragraph.</p>
One thought on “HTML STYLES”
Comments are closed.