Html Attributes


Html Attributes: Html element’s attribute are used to provide some more information about the element.


This way you can use Attributes Syntax

<start_tag attribute_name="Attribute Value"></end_tad>

Note 1 : Attributes are always defined in the start tag of the element.
Note 2 : Single Quote or double Quote any one can be used.
Example :

<start_tag attribute_name='Attribute Value'></end_tad>

Lets Understand with very simple examples:

Html Attributes Example : Title

Example

<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>


<p title="My first Paragraph">Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....</p>

</body>
</html>

Try it »

Output :

Html Attributes Example

Html Attributes Example

Attributes Example : href

Example

<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>

<a href="https://www.google.com"> Google.com</a>

</body>
</html>

Try it »

Output :


Advertisements

Add Comment

📖 Read More