HTML Attributes
An HTML element could have one or more attributes. Attributes are used to enrich the element functionality.
Let's examine the following link element
<a href="http://www.google.com">The link opens GOOGLE within our browser</a>
In this case the href is an attribute.
The image element.
<img src="http://website.com/assets/images/image-1400x933-23.jpg" alt="website.com" width="204" height="142">
We can clearly see that there are extra things under the <img> element. The image element is enriched by the width and the height. Also, the alt attribute too.
We can also add another attribute here and that is the alt='alt attribute' to the image.
HTML Attributes could be used in combination with double quote “ or single quote '
alt =”image.jpeg” or alt='image.jpeg”
Attributes are also used to enrich the HTML webpage itself too. In our case we can specify the language being used within the coding structure by simply adding this line of code;
<html lang="en-US"> under the <!DOCTYPE html>
That simply tells the webpage that we use United States English language. This could be UK English, German, etc
Paragraph has a title attribute which is sort of like a tool tip'
<p title = Important HTML Attributes>Content</p>
Comments
Post a Comment