HTML Attributes:-
HTML Attributes provide us more additional information about elements. HTML Attributes help us for a better understanding of HTML elements.
- All HTML elements can have attributes.
- Attributes provide us more or additional information about the elements.
- Attributes always specify or will come at the starting tag.
- Attributes usually come in name/value pairs like name="value".
The href Attributes:-
The <a> defines a hyperlink. The href attributes specify the URL that will go where you want your viewer will go. Hyperlink helps users you can add images, videos or so many other things.
<a href="https://mountyrain.blogspot.com/"> visit my website </a>
Try this code for a better experience
The src Attribute:-
The <img> tag is used to add images to your HTML page you can embed any image in your HTML page. The scr Attribute specifies the path where your image is located. The scr Attribute will go to your user where your image is located.
If you don't know about HTML Elements click on the link first and learn before learning HTML Attributes.
There are basically two ways to specify the URL in src Attribute.
1. Absolute URL:-
This way is used when your image has hosted another web. This is used only for the external images, not you.
NOTE:- The image you get from the other web may be copyrighted. If you don't have copyright authority this may be trouble for you so before use, an image that want to you use takes copyright authority from the authorized person.
2. Relative URL:-
This way is used when the image is hosted by you it means the image that you want to use should be on your web.
TIPS:- The relative URL is best for you because in this way there is no copyright issue way your web will be safe.
The width and height Attributes:-
The <img> tag contains more than two Attributes one is the width and the other one is height. This Attribute specifies the width and height of the image that you embed in your web in pixels.
The alt Attribute:-
The alt also has another Attribute that is used in <img> tag. The alt Attribute specifies an alternate text about your image.
<img scr="https://i.ytimg.com/vi/VNw270gFttI/maxresdefault.jpg" alt="Earn money online">
Try this code for a better experience
The style Attribute:-
The style Attribute is used for styling anything on the HTML page such as font, color, size, and more.
The title Attribute:-
The title Attribute provides additional information about the element. The value of the title attribute will be displayed as a tooltip when you mouse over the element.
<!DOCTYPE html>
<html>
<body>
<h1 title=" I' am a heading"> This is heading </h>
<p title="I' am a tooltip"> Mouse over this paragraph, to display the title attribute as a tooltip. </p>
</body>
</html>
Try this code for a better experience

0 Comments