In previous tutorials we discuss about html elements and tags. Some html elements have predefined attributes (like <a href=””></a>, <p title=””></p>) and a few not. Most of elements attributes are common in html4. An attribute is used to define the additional information about an element and is specified inside the element’s opening tag. All attributes are divided into two parts: a name and a value.
Html Title Attributes:
The title attribute offers an advised title for the elements. Title is show in the form of popup, and it appears when we move the cursor over the elements.
<!DOCTYPE html> <html> <head> <title>The title Attribute Example</title> </head> <body> <h1 title=”html tutorials book”> Product title </<h1> </body> </html>
Move hover for check the results.
Html Alt Attributes:
The alt attribute provides an alternative text for elements. I.e. If image are not display on the screen(because network error, src path invalid ), then alt attribute value show on the place elements.
<img src=" trickcollab.png" alt="trickcollab.com">