Element Attributes - HTML CSS HTML

HTML CSS examples for HTML:Attribute

Introduction

You can add attribute to elements.

The following code shows an attribute that applies to the element.

I like <a href="page.html">CSS</a> and HTML.

Attributes can be added only to start tags or single tags.

There are a set of global attributes that can be applied to any HTML element.

Elements can also have their own attributes.

You can use double quotes "myvalue" to delimit the attribute value, and you can also use single quotes 'myvalue'.

To specify a value with quotes in it, use both styles "my'quoted'value" or 'my"quoted"value'.

Multiple Attributes to an Element

You can apply multiple attributes to an element.

I like <a class="link" href="/page.html" id="firstlink">CSS</a> and HTML.

The order of the attributes is not important.


Related Tutorials