What is Attributes in HTML
w3hello.com logo
HTML Basics
What is HTML
Introduction to HTML
HTML Introduction, What is HTML
What is XHTML
What is Attributes in HTML
HTML Formatting
Bold and Italics in HTML
HTML Heading
HTML Elements
HTML Standard Fonts
HTML Forms
HTML Comments
HTML Table
HTML Input Types
HTML Image Links
HTML Text Links
HTML Colors
HTML Title
HTML Paragraphs
HTML Frames
HTML Anchor
HTML Charset
HTML URL Encoding
HTML Backgrounds
HTML Image
HTML Text Formatting
HTML Tables
HTML Basic
HTML Color Names
HTML Input Attributes
HTML Paragraph
HTML Images
Why use XHTML
HTML global attribute spellcheck
Styling the HTML5 Tags
HTML Computer Code Elements
HTML Layout
HTML Entities
HTML Headings
HTML Symbols
XHTML Tips and Tricks
HTML Form Layouts
HTML Table Vs Div Based Layouts
HTML Drag and Drop
HTML Unordered List | HTML Bulleted List
Discuss XHTML
HTTP Status Codes - List of Standard Server Response Codes
HTML global attribute dir
HTML Attributes
HTML Form Elements
HTML Iframes
500+ HTML Color Names
HTML tables - cell alignment, colours, images
HTML Lists
HTML YouTube Videos
How to create a basic html template
HTML Google Maps
HTML Quick Guide
XHTML Quick Guide
Spinners and Sliders in HTML 5
HTML Blocks
HTML Layouts
MIME Media Types
HTML Reference: Special Characters
HTML Exercises
HTML global attribute lang
Getting Started with Tags in HTML and HTML5
HTML Block and Inline Elements
XHTML Introduction
Working with HTML Head Elements
XHTML Useful Resources
Adding captions to images in HTML
HTML 5 Video and Audio
Execute HTML Online
HTML Overview
HTML Video
XHTML Doctypes
HTML 5 Form Elements
учебное руководств HTML
HTML5 Tables
HTML Multimedia
HTML Audio
HTML global attribute data-*
A simple one column layout with HTML5
HTML global attribute contenteditable
HTML global attribute accesskey
HTML Email Links
HTML Ordered, Unordered, and Definition Lists
HTML Style Sheet
HTML Styles
XHTML Summary
HTML global attribute draggable
HTML Character Encodings
HTML Basics
Previous : What is XHTML Next : HTML Formatting

What is Attributes in HTML

Attributes define additional properties of an element.

HTML Attributes

Certain parameters are frequently included within the opening tag to provide additional element properties (such as colorization, measurement, location, alignment, or other appearances) to the data between the markup tags. These parameters are called Attributes.


Note:Attributes are always specified in the start tag (or opening tag), and they can only contain the value of the attribute.

Attribute Values

Most attributes require a value. In HTML, the value can be left unquoted if it doesn't include spaces (name=value), or it can be quoted with single or double quotes (name='value' or name="value"). By the way, it is recommended to enclose Attribute values in quotes.

For example, the abbr element, which represents an abbreviation, expects a title attribute with its expansion. This would be written as:

<abbr title="Hyper Text Markup Language">HTML</abbr>

Tip:In some rare situations, when the attribute value itself contains quotes, it is necessary to wrap attribute value inside single quotes: name='John ''Williams'' Jr.'

Attribute Example

In the example below href is attribute and the link provided is its value.

HTML links are defined with the <a> tag. You will learn about links in upcoming tutorials.

  • <!-- link to w3hello.com -->
  • <a href="https://www.w3hello.com">Tutorial Republic</a>
  • <!-- link to google.com -->
  • <a href="https://www.google.com">Google</a>

Note:Attribute values are generally case-insensitive, except certain attribute values, like the id and class attributes. However, World Wide Web Consortium (W3C) recommends lowercase for attributes values in their specification.

A complete list of attributes for each HTML element is listed inside: HTML Tag Reference.

Previous : What is XHTML Next : HTML Formatting
© Copyright 2018 W3Hello Publishing Limited. All rights reserved.
Contact us | Sitemap