HTML for Beginners, Testers | HTML Attributes - Software Testing

Empowering Technology

Post Top Ad

Responsive Ads Here

Sep 23, 2020

HTML for Beginners, Testers | HTML Attributes

 There are few attributes in HTML which are widely used and provide additional information about web elements. The most important ones are listed below:

1. href attribute
<a href="">Visit Ishan's blog</a>
Here href is the attribute that defines URL to open on clicking Anchor text.

2. src, width & height attributes
<img src="" width="400" height="300">
Here src, width, height are the attributes defining absolute path and dimensions of the image.

3. alt attribute
<img src="" alt="Profile Picture">
Here alt atribute defines alternative text in case any image is unable to load.

4. style attribute
style attribute is used to add color, font, size, and more to a webelement.
<p style="color:blue;">This is a blue paragraph.</p>

5. lang Attribute
Used to define the language of webpage for browser to understand. It's always a good practice to add lang.
<!DOCTYPE html>
<html lang="en">

6. title attribute : Displays Help Text on Mouseover
<p title="This is a tooltip">This is a paragraph.</p>

Copy Paste Below code in Notepad --> Save with extension .html  and open it in Browser to practically see what we learnt from this Tutorial.



No comments:

Post a Comment

Thanks a lot for your valuable Comment!

Post Bottom Ad

Responsive Ads Here