HTML Attributes
HTML Attributes
.NET,
html
attributes
Recap?
What can you remember
about our last topic.
How many HTML
Elements does it
have?
4
How many HTML
Elements does it
have?
3
How many Empty
HTML Elements
does it have?
4
The whole HTML
element is supposed to
show on my webpage.
Is this true or false?
False, only the
contents should
appear on my
webpage
What do you mean by
nested HTML Element
It means that html
elements can
contain other html
elements
Lesson 12
After this lesson, you will be able to
answer the following questions:
✓ What is an HTML Attribute?
✓ What is an Attribute name?
✓ What is an attribute value?
html
Attributes
HTML Attributes
• All HTML elements can have attributes
• Attributes provide additional information about elements
• Attributes are always specified in the starting tag
• Attributes usually come in name/value pairs like
Example “name of attribute”=“attribute value"
example
Wow! Is that
magic
Let’s
investigate
this code
HTML Element
<a href=“https://www.youtube.com”>Youtube </a>
Ending tag
<a href=“https://www.youtube.com”>Youtube </a>
Content
<a href=“https://www.youtube.com”>Youtube </a>
Starting tag
The opening
tag seems to
be a bit longer
Attribute
Take note that the
attribute consists of
Attribute name and
attribute value
Attribute name
Take note that the
attribute consists of
Attribute name and
attribute value
Attribute Value
attribute values
should always be
quoted in HTML
space
Take note!
The attribute is always separated by a
space from its main tag
this is how we write the syntax of the HTML
element
<a>
#2 if you are going to add an attribute you
need to type a space before the attribute
<a href
space
<a href=“https://www.youtube.com”>Youtube </a>
Attribute Attribute
name value
content
Ending
tag