Ask a Teacher



Write the syntax of attributes ?

Attributes give certain characteristics to an element (e.g., height, color, relationship, etc.), sometimes very important, that will finally set how it must be interpreted. For example, the HTML a element inserts a link in an HTML document (a way to go from the actual document to another resource, usually with a click), but the rel attribute establishes which is the relationship between the actual document and the destination resource.

Even when many attributes are shared by many elements, each element has a default set of attributes according to the standard that's being used. To see the attributes that an element accepts, check the description for that element in our list of HTML tags

As we saw in the generic example every attribute must have a value and must be defined in the start tag. In this example we insert a full definition (with content and closing tag) of an HTML a element with two attributes: "href" and "rel".



comments powered by Disqus