Introduction
Before reading this article please visit the following links:
HTML Attributes
- HTML elements can have attributes
- Attributes provide additional information about an element
- Attributes are always specified in the start tag
- Attributes come in name/value pairs like: name="value"
- The document language can be declared in the <html> tag.
- The language is declared in the language attribute.
- Declaring a language is important for accessibility applications (screen readers) and search engines
Example
- <!DOCTYPE html>
- <html lang="en-US">
- <body>
- <h1>My First Heading</h1>
- <p>My first paragraph.</p>
- </body>
- </html>
- The first two letters specify the language (en). If there is a dialect, use two more letters (US).
The title attribute. - HTML paragraphs are defined with the <p> tag.
Example
- <p title="c-sharpcorner">c-sharpcorner is a website in which the articles, blogs… etc are written on “TECHNOLOGY ”.
- </p>
HTML links are defined with the <a> tag. The link address is specified in the href attribute.
Example
- <a href="http://www.c-sharpcorner.com">This is a link</a>
- HTML images are defined with the <img> tag.
- The filename of the source (src) and the size of the image (width and height) are all provided as attributes.
Example
- <img src=" E:\Walls\HTML\c#corner.jpg" width="104" height="142”

The alt Attribute
The alt attribute specifies an alternative text to be used when an HTML element cannot be displayed.
Example
- <img src=" E:\Walls\HTML\c#corner.jpg"alt="www.c-sharp corner.com" width="104" height="142” >
- The HTML5 standard does not require lower case attribute names.
- The title attribute can be written with an upper or lower case like Title and/or TITLE.
- Lower case is the most common.
- Lower case is easier to type.
Summary
- All HTML elements can have attributes.
- The HTML title attribute provides additional "tool-tip" information.
- The HTML href attribute provides address information for links.
- The HTML width and height attributes provide size information for images.
- The HTML alt attribute provides the text for screen readers.
- Always use lowercase HTML attribute names.

Shresthi JaiswalPosted Sep 23, 2016, 3:01 AM
Thanks Sir :)
SubashPosted Sep 23, 2016, 12:35 AM
Nice explanation
Shresthi JaiswalPosted Apr 13, 2015, 2:41 PM
thankyou :)
Karthik Muthu KaruppanPosted Apr 13, 2015, 1:36 PM
Good
Shresthi JaiswalPosted Apr 13, 2015, 7:15 AM
thanks!! :)
Sanjay SinghPosted Apr 13, 2015, 5:40 AM
nice ... keep going
Shresthi JaiswalPosted Apr 13, 2015, 2:33 AM
thanku !! :)
Sibeesh VenuPosted Apr 13, 2015, 1:59 AM
Good one :)
NitinPosted Apr 12, 2015, 4:20 PM
good one
Shresthi JaiswalPosted Apr 12, 2015, 5:27 AM
thnq !! :)
Abhishek JaiswalPosted Apr 12, 2015, 5:10 AM
Good work! :)
Shresthi JaiswalPosted Apr 11, 2015, 1:27 PM
thankew !! every one :)
Gowtham RajamanickamPosted Apr 11, 2015, 1:09 PM
well explained
Gowtham RajamanickamPosted Apr 11, 2015, 1:09 PM
good
Santhakumar MunuswamyPosted Apr 11, 2015, 12:53 PM
Good