HTML ATTRIBUTES (5)

attributes 5

Html elements can also contain attributes. HTML attributes provide extra information about HTML elements. HTML attributes general syntax is name=”value”. Moreover HTML attributes are always defined in start tag.e.g.

<a href=”index.html”> index</a>

In this example href is given as an HTML attribute to the <a>…</a> tag. Note that attribute is given in start tag. Also note the syntax of defined attribute.


HTML Attributes:

Attributes values are always quoted. There are some cases when attributes values have either double or single quotation marks in them then the syntax should be:

Name=”value ’single quotes ’double quotes”

Name=’value ”double quotes” single qoutes’

In this example href is given as an HTML attribute to the <a>…</a> tag. Note that attribute is given in start tag. Also note the syntax of defined attribute.


Example4.1:

<html>

 

<head>

<title>Website-School/HTML Attributes example 1</title>

</head>

 

<body>

 

<img src=”homeb.gif” width=”153″ height=”73″ alt=”home” />

<p> This image is displayed using image tags inside the body tags. Src, width, height and alt are given as attributes to an image tag.</p>

</body>

</html>


For more visit next posts in this category.To go back to Contents of this tutorial: Contents of HTML Tutorial

email

One Response to HTML ATTRIBUTES (5)

  1. I love the theme here. Is it downloadable anywhere?

Leave a Reply