HTML Attributes


HTML Attributes

We have many attributes in the HTML. The attributes are not individual. That attributes are specified in the open tag. Every HTML  elements have attributes. This attributes are have more information about the tag. With the help of some attributes we can make an efficient website.
This attributes contains name and value like name: "value".
The name and values are in lower case only.

List of some Attributes

href - hypertext reference (With this href attribute we add an external link in the web page by using this href attribute. This is used in <a> tag)


src - source ( With this src attribute we can import the image by adding the path. This is used in <img> tag.) 


height  - height (With this we can change/fix the height of content/image)


width - width (With this we can change/fix the width of content/image)


alt - alternative (This alternative is used in img tag means if an image doesn't load or path mistake then the matter which is in this alt attribute will be displayed)


Some more examples are:

style

lang

title


Example Program:-

<html lang="en-US">

<head>

<title>CT blog</title>

</head>

<body>

<a href="https://codetech.blogspot.com">CT blog</a>

<img src="img_girl.jpg" alt="Image" width="500" height="600">

<p style="color: red;">This is a red paragraph.</p>

</body>

</html>


Try it...


Post a Comment

Previous Post Next Post