HTML – Attributes
An attribute is used to provide extra or additional information about an element. It takes two parameters name and value. The name parameter takes the name of the property we would like to assign to the element and the value takes the properties value or extent of the property names that can be aligned over the element. Every name has some value that must be written within quotes.
Example: This example illustrates the use of href, height,width and src attribute in an HTML document.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<title>HTML Attributes</title>
</head>
<body>
<h2>Link with href Attribute</h2>
<a href="https://www.w3wiki.org/"
target="_blank" title="Geeks">
w3wiki
</a>
<h2>Image with src, height, and width Attributes:</h2>
<img src="https://media.w3wiki.org/gfg-gg-logo.svg"
alt="w3wiki Image" height="200"
width="300">
</body>
</html>
Output:
HTML Course Basics of HTML
In this article, we will go through all the basic stuff required to write HTML. There are various tags that we must consider and know about while starting to code in HTML. These tags help in the organization and basic formatting of elements in our script or web pages. These step-by-step procedures will guide you through the process of writing HTML.
Table of Content
- HTML Paragraph
- HTML Horizontal Lines
- HTML Images
- HTML Attributes
- HTML Comments
- HTML Lists