HTML Attribute

HTML Attribute

In this lesson, we’re going to learn about HTML attributes

An attribute is the one that provides information about HTML elements.

HTML attributes are always found in the opening tags. It starts after the keyword of your opening tag and ends before the > of the opening tag.

Format of HTML attribute:

nameOfattribute=”someValue” or nameOfattribute=’someValue’

<h2 align="left" >this text is align left</h2>

where:

nameOfattribute is the property you want to set, design and change.  Example is the alignment attribute of text or paragraph <align>.

”someValue” = is the value of the attribute you have defined. Example you want to align your text or paragraph to the right. <align>=”left”.

Note:  Attribute names and attribute values are case-insensitive (use lowercase – it is the recommended format).

don’ts:

nameOfattribute=’someValue” or nameOfattribute=”someValue’ (don’t mix the single and double qoutation)

nameOfattribute=” someValue ” (having a space in the value will change its value because everything inside the quotes is the value itself)

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.