The html style is a attribute :
To shows common way to style all HTML elements.
Styles was introduced with HTML version 4, as the new features and preferred way to style HTML elements. With HTML styles, styles can be added to HTML elements directly by using the style attribute. when ever for appling html style the result is showing attractive web pages.
You can learn everything about styles and CSS in our CSS Tutorial.
In this HTML tutorial we will use the style attribute to introduce you to HTML styles.
The font-family, color, and font-size properties defines the font, color, and size of the text in an element in html style attribute
Style Example:
<html>
<body>
<h1 style="font-family:verdana">heading</h1>
<p style="font-family:arial;color:red;font-size:20px;">paragraph.</p>
</body>
</html>
Output
heading
paragraph.
The text-align property specifies the horizontal alignment of text in an element:
Text Alignment:
<html>
<body>
<h1 style="text-align:center">This is a heading</h1>
<p>The heading above is aligned to the center of this page.</p>
</body>
</html>
Output
Heading
paragraph is aligned to the center of this page.