SlideShare a Scribd company logo
HTML Attributes
 Every tag can contain attributes
 Attributes are used to provide additional information about

HTML elements.
 HTML elements can have attributes
Syntax:
Attributename=“attribute value”
Ex:
Bgcolor=“red”
 Attributes are always specified in the start tags
i.e:
<body bgcolor=“red”> ----starting tag
</body>
http://improvejava.blogspot.in
 Attribute values can be specified in single

quotes or double quotes
 Attribute names and attribute values are case
insensitive but preferable is lower case letter
according to world wide web
consortium(w3c) which recommends but not
rule.
 But newer versions of xhtml will demand
lower case attributes.
http://improvejava.blogspot.in
 Attributes come in name/value pairs







like: name="value"
Attribute Example
HTML links are defined with the <a> tag. The
link address is specified in the href attribute:
Example
<a
href="http://improvejava.blogspot.in">This is
a link</a>
http://improvejava.blogspot.in









Always Quote Attribute Values
Attribute values should always be enclosed in quotes.
Double style quotes are the most common, but single style
quotes are also allowed.
Tip: In some rare situations, when the attribute value itself
contains quotes, it is necessary to use single quotes: name='John
"ShotGun" Nelson'
HTML Tip: Use Lowercase Attributes
Attribute names and attribute values are case-insensitive.
However, the World Wide Web Consortium (W3C) recommends
lowercase attributes/attribute values in their HTML 4
recommendation.
Newer versions of (X)HTML will demand lowercase attributes.
http://improvejava.blogspot.in
 HTML Attributes Reference
 A complete list of legal attributes for each HTML

element is listed in our: HTML Tag Reference.
 Below is a list of some attributes that can be used on
any HTML element:
 AttributeDescriptionclassSpecifies one or more
classnames for an element (refers to a class in a style
sheet)idSpecifies a unique id for an
elementstyleSpecifies an inline CSS style for an
elementtitleSpecifies extra information about an
element (displayed as a tool tip)For more
information about global attribute
http://improvejava.blogspot.in
http://improvejava.blogspot.in

More Related Content

PPT
2. html attributes
PPT
JSP Custom Tags
PPTX
Images and Lists in HTML
PPT
JavaScript Workshop
PPT
Html JavaScript and CSS
PPTX
Introduction to Javascript
PPTX
JSP custom tags
KEY
Introduction to HAML
2. html attributes
JSP Custom Tags
Images and Lists in HTML
JavaScript Workshop
Html JavaScript and CSS
Introduction to Javascript
JSP custom tags
Introduction to HAML

What's hot (20)

PPTX
PDF
Html,javascript & css
PPT
Javascript
PPT
AJAX Workshop Notes
ODP
Creating Web Sites with HTML and CSS
PPTX
HTML Lists & Llinks
PPT
A quick guide to Css and java script
PPTX
JavaScript with Syntax & Implementation
ODP
HTML 5 Simple Tutorial Part 3
PPTX
Esd input inplace
PPTX
PDF
Intro to jQuery
PPSX
DIWE - Coding HTML for Basic Web Designing
ODP
HTML 5 Simple Tutorial Part 4
PDF
Intro to Javascript and jQuery
PPTX
Learning jsp
PDF
Client side scripting
DOCX
Xhtml
PPTX
Java script
PDF
Web Development 1 (HTML & CSS)
Html,javascript & css
Javascript
AJAX Workshop Notes
Creating Web Sites with HTML and CSS
HTML Lists & Llinks
A quick guide to Css and java script
JavaScript with Syntax & Implementation
HTML 5 Simple Tutorial Part 3
Esd input inplace
Intro to jQuery
DIWE - Coding HTML for Basic Web Designing
HTML 5 Simple Tutorial Part 4
Intro to Javascript and jQuery
Learning jsp
Client side scripting
Xhtml
Java script
Web Development 1 (HTML & CSS)
Ad

Viewers also liked (20)

PPTX
Sessionex1
PPT
Class
PPTX
Exceptions
PPTX
Different waysconnect
PPT
Class
PPTX
Interface connection
PPTX
Get data
PPTX
1 introduction to html
PDF
Using html editor to add hyper link in moodle course
KEY
Using html editor to insert an image in moodle
PDF
บทที่ 3 html editors
PPTX
Role of Meta Title Tag in SEO
PPTX
PPT
static dynamic html tags
PPTX
Overview HTML, HTML5 and Validations
PPTX
Markup language classification, designing static and dynamic
PPTX
The Difference between HTML, XHTML & HTML5 for Beginners
PDF
Title Tag Optimization (Public)
PDF
Up to Speed on HTML 5 and CSS 3
Sessionex1
Class
Exceptions
Different waysconnect
Class
Interface connection
Get data
1 introduction to html
Using html editor to add hyper link in moodle course
Using html editor to insert an image in moodle
บทที่ 3 html editors
Role of Meta Title Tag in SEO
static dynamic html tags
Overview HTML, HTML5 and Validations
Markup language classification, designing static and dynamic
The Difference between HTML, XHTML & HTML5 for Beginners
Title Tag Optimization (Public)
Up to Speed on HTML 5 and CSS 3
Ad

Similar to 2. attributes (20)

PPTX
HTML 5 Topic 2
PPTX
AttributesL3.pptx
PPTX
Introduction to Html
PDF
HTML - part 1
PDF
Web Development 3 (HTML & CSS)
PDF
Web Dev Workshop at GDG on Campus:MGMCOE
PPTX
HTML Attributes.pptx
PDF
html-basic.pdf
PDF
CSS Foundations, pt 1
PPTX
Html basics
PPTX
PPTX
Html Workshop
DOCX
Computer application html
PPTX
Frontend Devlopment internship batch 2024.pptx
PPTX
Frontend Devlopment internship batch 2024-2.pptx
PPTX
HTML Attributes.pptx
PDF
HTML Foundations, part 1
PPTX
HTML 5: Attributes
PDF
Class Intro / HTML Basics
PPTX
Html basic
HTML 5 Topic 2
AttributesL3.pptx
Introduction to Html
HTML - part 1
Web Development 3 (HTML & CSS)
Web Dev Workshop at GDG on Campus:MGMCOE
HTML Attributes.pptx
html-basic.pdf
CSS Foundations, pt 1
Html basics
Html Workshop
Computer application html
Frontend Devlopment internship batch 2024.pptx
Frontend Devlopment internship batch 2024-2.pptx
HTML Attributes.pptx
HTML Foundations, part 1
HTML 5: Attributes
Class Intro / HTML Basics
Html basic

More from myrajendra (20)

PPT
Fundamentals
PPT
Data type
PPTX
Hibernate example1
PPTX
Jdbc workflow
PPTX
2 jdbc drivers
PPTX
3 jdbc api
PPTX
4 jdbc step1
PPTX
Dao example
PPTX
Internal
PPTX
3. elements
PPTX
Headings
PPTX
Forms
PPT
PPTX
Views
PPTX
Views
PPTX
Views
PPT
Starting jdbc
PPTX
Properties
PPTX
Java.sql package
PPTX
Interface callable statement
Fundamentals
Data type
Hibernate example1
Jdbc workflow
2 jdbc drivers
3 jdbc api
4 jdbc step1
Dao example
Internal
3. elements
Headings
Forms
Views
Views
Views
Starting jdbc
Properties
Java.sql package
Interface callable statement

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
Teaching material agriculture food technology
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
NewMind AI Monthly Chronicles - July 2025
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Empathic Computing: Creating Shared Understanding
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Teaching material agriculture food technology
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Approach and Philosophy of On baking technology
Review of recent advances in non-invasive hemoglobin estimation
Dropbox Q2 2025 Financial Results & Investor Presentation
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf
cuic standard and advanced reporting.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Electronic commerce courselecture one. Pdf
NewMind AI Monthly Chronicles - July 2025

2. attributes

  • 1. HTML Attributes  Every tag can contain attributes  Attributes are used to provide additional information about HTML elements.  HTML elements can have attributes Syntax: Attributename=“attribute value” Ex: Bgcolor=“red”  Attributes are always specified in the start tags i.e: <body bgcolor=“red”> ----starting tag </body> http://improvejava.blogspot.in
  • 2.  Attribute values can be specified in single quotes or double quotes  Attribute names and attribute values are case insensitive but preferable is lower case letter according to world wide web consortium(w3c) which recommends but not rule.  But newer versions of xhtml will demand lower case attributes. http://improvejava.blogspot.in
  • 3.  Attributes come in name/value pairs     like: name="value" Attribute Example HTML links are defined with the <a> tag. The link address is specified in the href attribute: Example <a href="http://improvejava.blogspot.in">This is a link</a> http://improvejava.blogspot.in
  • 4.        Always Quote Attribute Values Attribute values should always be enclosed in quotes. Double style quotes are the most common, but single style quotes are also allowed. Tip: In some rare situations, when the attribute value itself contains quotes, it is necessary to use single quotes: name='John "ShotGun" Nelson' HTML Tip: Use Lowercase Attributes Attribute names and attribute values are case-insensitive. However, the World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4 recommendation. Newer versions of (X)HTML will demand lowercase attributes. http://improvejava.blogspot.in
  • 5.  HTML Attributes Reference  A complete list of legal attributes for each HTML element is listed in our: HTML Tag Reference.  Below is a list of some attributes that can be used on any HTML element:  AttributeDescriptionclassSpecifies one or more classnames for an element (refers to a class in a style sheet)idSpecifies a unique id for an elementstyleSpecifies an inline CSS style for an elementtitleSpecifies extra information about an element (displayed as a tool tip)For more information about global attribute http://improvejava.blogspot.in