Things you want to know about websites

 

Attributes & Values

Attributes are combined or associated with elements. They give additional information or details about the element they are used with.

Every attribute is accompanied with a value, which describes how much or in what way that attriubute will effect the element.

Attributes and their values are always given in the opening tag of an element.

Attribute syntax

Attributes are used in the following way,

attribute="value"

The value is always in "" quotations marks in Xhtml. Whereas in Html quotation marks are not necessary. It is always a good practice to include quotation marks whatever type of html you use.

Examples

<p align="center">

Here align attribute is used with value "center". This wil position the contents of the <p> tag in the center.

<table border="1">

Here border attribute is used with value "1". This will draw a border around the table.

<p id="message">

Here id attribute is used with value "message". This will assign the <p> tag an id named "message".


Bookmark or Add to Favourites

Next :

Html Document Structure

Related:

Html Basic Document Example

Link to this page :

Copy and paste the following code in an html document to link to this page,