The HTML Attributes

This tutorial is for beginners. In this tutorial, you will learn HTML attributes. How to use these attributes to tags?

What are HTML Attributes?

It describes the additional properties of the elements such as height and width of the button or any element you are using you can give them height and width by using attributes. Attributes are describes in the opening tag and normally consist of name pairs such as type=”email” or name=”value”. It should be enclosed in quotation marks.

Some attributes are needed for a certain element. However, a <ifram> tag must have a source “src” attribute. Let’s take a look at the example of HTML attributes.

<!DOCTYPE html>
<h2>HTML Iframe</h2>
<p>You can use the height and width attributes to specify the size of the iframe:</p>
<iframe src="" height="200" width="300"></iframe>

In above example src inside the <iframe> tag is an attribute and the link assigned that its value.

Class Attribute:

The class attribute describes one or more class names for an element.
The class attribute is normally use to point a class in a cascading style sheet (CSS). However, it can also be use by Javascript to make changes in HTML elements with an assigned class.

h1.intro {
    color: blue;
p.important {
    color: green;
<h1 class="intro">Heading</h1>
<p class="important">Note that this is an important paragraph. :)</p>

However, if you want to more about programming, computer, networking, SEO, Digital Marketing. So don’t forget to subscribe to our newsletter.

Best Of Luck keeps learning to program.

1 thought on “The HTML Attributes”

  1. Fantastic goods from you, man. I’ve understand
    your stuff previous to and you are just too great.
    I actually like what you have acquired here, really like what you’re saying and the way in which
    you say it. You make it entertaining and you still take care of to keep it sensible.
    I can not wait to read much more from you. This is really a
    wonderful site.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top