HTML TAG ATTRIBUTES
Speaking of “HTML TAG ATTRIBUTES” the first and important consideration is that attributes allow us to provide extra information to the Tags. They consist of key-value pairs:
SPECIFIC AND GLOBAL ATTRIBUTES
Tag attributes can be specific to one or more tags or global. Here is a table relating to the global attributes (those present in all HTML tags) present in the W3School site.
THE IMG TAG (IMAGE)
The <img> tag is used to embed an image in an HTML page. The images are not technically inserted in a web page, they are linked to it. The <img> tag creates a containment space for the reference image. It has two mandatory attributes:
- src – Specifies the path to the image
- alt – Specifies alt text for the image, if the image for some reason cannot be displayed
Note: Always specify the width and height of an image as well. If the width and height are not specified, the page may flicker while loading. to link an image to another document, simply nest the <img> tag inside an <a> tag.
<a href=”https://www.marcoalbasini.com”>
<img src = ”logo.webp” alt = “site web” width = “80” height = “72”>
</a>
THE TAG A (ANCHOR)
The <a> tag defines a hyperlink, used to link one page to another. The most important attribute of the <a> element is href, which indicates the target of the link. By default, links will appear as follows in all browsers:
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
Leave A Comment