Menu Close
HTML Tutorial

HTML Attributes

The HTML attributes provide the additional information about the HTML elements or tags. 

The attribute contains the value and the value modifies the attribute. You can check the below example to understand the attributes

Example

<html>
<head>
<title>HTML Attributes</title>
</head>
<body>
<h3>HTML Attributes Example</h3>
<p align="left">Paragraph</p>
<p align="center">Paragraph</p>
<p align="right">Paragraph</p>
</body>
</html> 

Output:

HTML-Attributes

Note: Here, the align attribute modifies the paragraph.

HTML Style attribute:

The style attribute defines the style of the html elements. It contains the CSS property and the CSS value. This attribute modifies the style of the web page contents.

Syntax

<tagname style="property:value;"> 

Example

<html>
<head>
<title>HTML Style attribute</title>
</head>
<body>
<h3>HTML Style Attribute Example</h3>
<p style="color:blue">Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
</body>
</html> 
Output:
HTML-Style-attribute