HTML – Attributes

HTML – Basic Tags
November 3, 2018
HTML – Formatting
November 3, 2018

We have seen few HTML tags and their usage like heading tags <h1>, <h2>,paragraph tag <p> and other tags. We used them so far in their simplest form, but most of the HTML tags can also have attributes, which are extra bits of information.

An attribute is used to define the characteristics of an HTML element and is placed inside the element’s opening tag. All attributes are made up of two parts − a name and a value

  • The name is the property you want to set. For example, the paragraph <p> element in the example carries an attribute whose name is align, which you can use to indicate the alignment of paragraph on the page.
  • The value is what you want the value of the property to be set and always put within quotations. The below example shows three possible values of align attribute: left, center and right.
  • The width and height Attributes
  • Images in HTML have a set of sizeattributes, which specifies the width and height of the image:
  • Example   <img src=”img_girl.jpg” width=”500″ height=”600″>
    Attribute Description
    alt Specifies an alternative text for an image, when the image cannot be displayed
    disabled Specifies that an input element should be disabled
    href Specifies the URL (web address) for a link
    id Specifies a unique id for an element
    src Specifies the URL (web address) for an image
    style Specifies an inline CSS style for an element
    title Specifies extra information about an element (displayed as a tool tip)
Sondiva Technologies
Sondiva Technologies
Sondiva Technologies started in 2011 with a vision of providing Quality based Web Hosting and Web Designing Services in Ghaziabad, Delhi NCR. Backed up by full stack developers and designers , with over 500+ Web Projects. They work on opensource Platforms like Wordpress, Magneto, Prestashop, Opencart and Core PHP. Other services are : Responsive Web Designing Domain Registration Services Dedicated & SSD Hosting Virtual Private Servers Google GSuite Mail Servers E-Commerce Shopping Portal Development Web Designing & Application Courses SEO & Digital Marketing

Leave a Reply

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

Shop Now