HTML style Attribute
The style attribute is used to provide various CSS effects to the HTML elements such as increasing font-size, changing font-family, coloring, etc.
Example: This example explains the HTML style Attributes to specify the style properties for the HTML element.
<!DOCTYPE html>
<html>
<head>
<title>style Attribute</title>
</head>
<body>
<h2 style="font-family:Chaparral Pro Light;">
Hello w3wiki.
</h2>
<h3 style="font-size:20px;">
Hello w3wiki.
</h3>
<h2 style="color:#8CCEF9;">
Hello w3wiki.
</h2>
<h2 style="text-align:center;">
Hello w3wiki.
</h2>
</body>
</html>
Output:
HTML Attributes
HTML attributes provide additional information about elements within an HTML document. Every HTML element can have attributes. Attributes are always defined in the start tag. They are specified using a name/value pair format, where the attribute name defines the property, and its value provides specific details, like name=”value”. These attributes impact content display and interaction on web pages.
Let’s explore the key aspects of HTML attributes:
Table of Content
- HTML Global Attributes
- HTML src Attribute
- HTML alt Attribute
- HTML width and height Attribute
- HTML id Attribute
- HTML title Attribute
- HTML href Attribute
- HTML style Attribute
- HTML lang attribute
Contact Us