Image

HTML & CSS - HTML ATTRIBUTE - HTML ATTRIBUTE

HTML ATTRIBUTE

Attributes provide additional information about HTML elements.

1) src

It is a necessary attribute that describes the source or path of the image. It instructs the browser where to look for the image on the server.

<!DOCTYPE html>
<html>
<body>

<img src="help4code.jpg" alt="help4code.com" width="100" height="142">

</body>
</html>
The location of image may be on the same directory or another server.
2) alt
The alt attribute defines an alternate text for the image, if it can't be displayed. The value of the alt attribute describe the image in words. The alt attribute is considered good for SEO prospective.
3) width
It is an optional attribute which is used to specify the width to display the image. It is not recommended now. You should apply CSS in place of width attribute.
4) height
It specifies the height of the image. The HTML height attribute also supports iframe, image and object elements. It is not recommended now. You should apply CSS in place of height attribute.
5)Title
It Specifies extra information about an element (displayed as a tool tip).
<!DOCTYPE html>
<html>
<body>

<h1>About help4code</h1>

<p title=About W3Schools>
Help4code.com is the largest collection of programs
</p>

<p><b>
 Here all technologies programs are available.
</b></p>

</body>
</html>
6) style
ItSpecifies an inline CSS style for an element.
7) href
HTML links are defined with the <a> tag. The link address is specified in the href attribute.
<html>
<head>
<title>
Href attribute
</title>
<body>
<a href="https://www.google.co.in/">Google link</a>
<hr>
<a href="https://help4code.com/">help4code</a>
<hr>
<a href="www.nagpuruniversity.org/">RTMNU link</a>
<hr>
<a href="https://mahah.sscboard.maharashtra.gov.in/">SSC board link</a>
<hr>
<a href="msbte.com/msbte/">MSBT link</a>
</body>
</html>