The HTML style attribute is used to add styles to an element, such as color, font, size, and more.
Setting the style of an HTML element, can be done with the style attribute.
The HTML style attribute has the following syntax:
<p> style="color:red;">Welcome to Soopro Pathshala</p>
The CSS background-color property defines the background color for an HTML element.
Example
<body style="background-color:skyblue;">
<h1>This is heading1<h1>
<body>
The CSS color property defines the text color for an HTML element:
Example
<h2 style="color:red;"> Welcome to soopro pathshala<h2>
The CSS font-family property defines the font to be used for an HTML element:
Example
<p style="font-family:verdana;">This is my paragraph</h1>
The CSS font-size property defines the text size for an HTML element:
Example
<p style="font-size:160%;">This is a paragraph.
The CSS text-align property defines the horizontal text alignment for an HTML element:
Example
<h1 style="text-align:center;">Centered Heading</h1>