HTML Attributes - HTML Tutorial - Punchitech


This website uploads some web development tutorials, like HTML, CSS, JavaScript, and Bootstrap also PHP and more stuff about web development.

Nov 27, 2019

HTML Attributes - HTML Tutorial

HTML attributes

Attributes are additional information provided for HTML elements.

HTML attributes

  • HTML elements can set attributes
  • Attributes can add additional information to the element
  • Properties are generally described in the opening tag
  • Attributes always appear as name / value pairs, for example: name = "value" .

Attribute instance

HTML links are defined by <a> tags. The address of the link is specified in the href attribute :

Example: <a href="">Punchitech</a>

HTML attributes commonly reference attribute values

Property values ​​should always be enclosed in quotes.
Double quotes are the most commonly used, but single quotes are fine.
Tip: In some individual cases, such as the attribute value itself contains double quotes, you must use single quotes, for example: name = 'HTML is a "Web Designing" Language'

HTML tip: Use lowercase attributes

Attributes and attribute values ​​are not case sensitive.
However, the World Wide Web Consortium recommends lowercase attributes/attribute values ​​in its HTML 4 recommendation.
Newer versions of (X) HTML require lowercase attributes.

Attributes Description
class Define one or more classnames for html elements (class names are imported from style files)
id Define the unique id of the element
style Specify the element's inline style
title Describes additional information about the element (used as a toolbar)

HTML Elements
HTML Basic Tags
HTML Editors
HTML Introduction