Web Design Tutorials 4: HTML5 Attributes

Web Design Tutorials 4: HTML5 Attributes

After defining HTML5 Tags and Elements in the previous section, we are ready to learn HTML5 Attributes.

HTML5 Attributes:

Actually HTML5 attributes add or provide more information about the HTML5 elements. All HTML elements can have attributes and they are always specified in the start tags. They usually come in pairs like: name =”value“.

Here are some HTML5 attributs:

    • lang attribute: This is to declare the document language. lang is declared inside <html> tag. Declaring a language is important for accessibility applications (screen readers) and search engines. have a look at codes below and focus:

      The first two letters specify the language (en). If there is a dialect, use two more letters (US).




  • title attribute: It displays a tool-tip on the screen while mouse hovers on the element. title can be added as attribute to the most of the tags, as below you can see that title attribute is added to the <p> element.
  • alt attribute: an alternative text when an image cannot be displayed on the screen.

    In the above code, if the image was not displayable because of any reason; the alt text will be displayed.
  • src attribute: the source attribute is used to give a path to catch the image or any other file like javascript. below example describes:
  • size attributes: 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; here width and height are the size attributes.
  • href attribute: The links inside the HTML5 are declared inside the href attributes in the <a> tags.

Next we will discuss More about HTML5 Tags and Elements in deep, stay tuned with CODEJOW.

Previous Comments and White Spaces in Visual Basic 2010
Next How to Process on One-Dimensional Array in C++

About author

Raza Bayani
Raza Bayani 42 posts

<p>Raza Bayani studies BCE (Bachelor in Computer Engineering) in Poly-technical University of Kabul. He is the CEO of CODEJOW group, a web designer, coder and recently a blogger. Raza thinks, he can help others and also boost-up his own programming skills being on codejow.com.</p>

View all posts by this author →

You might also like