8
UNDERSTANDING HTML Tags VS Attributes

UNDERSTANDING HTML Tags VS Attributes. Element An element in HTML represents some kind of structure and generally consists of a start tag, content, and

Embed Size (px)

Citation preview

Page 1: UNDERSTANDING HTML Tags VS Attributes. Element An element in HTML represents some kind of structure and generally consists of a start tag, content, and

U N D E R S TA N D I N G H T M L

Tags VS Attributes

Page 2: UNDERSTANDING HTML Tags VS Attributes. Element An element in HTML represents some kind of structure and generally consists of a start tag, content, and

Element

An element in HTML represents some kind of structure and generally consists of a start tag, content, and an end tag.

Page 3: UNDERSTANDING HTML Tags VS Attributes. Element An element in HTML represents some kind of structure and generally consists of a start tag, content, and

Tag

Tags are used to mark up the text.A Start Tag consists of an opening angle bracket (<),

the element, the attribute, and the closing bracket. <body> start tag with no attribute

An End tag consists of an opening angle bracket followed by a forward slash, the element name, and a closing angle bracket </body>

Page 4: UNDERSTANDING HTML Tags VS Attributes. Element An element in HTML represents some kind of structure and generally consists of a start tag, content, and

Empty Container

There are also some elements that are empty, meaning that they only consist of a single tag and do not have any content. In HTML, such tags look just like opening tags:

<br><hr><img src>

Page 5: UNDERSTANDING HTML Tags VS Attributes. Element An element in HTML represents some kind of structure and generally consists of a start tag, content, and

Attributes

An attribute defines a property for an element, consists of an attribute, and appears within the element’s start tag.

Tags Attributes

<body bgcolor= “black” text=“white” link= “red” vlink= “pink”> … </body>

Page 6: UNDERSTANDING HTML Tags VS Attributes. Element An element in HTML represents some kind of structure and generally consists of a start tag, content, and

Tag Attributes

Shirt

Jewelry

Long sleeve, blue, turtle neck, sweater

Bracelet, silver, with round diamonds and saphires, and a heart charm.

Tags VS Attributes

Attributes are ways to describe your tags!

Page 7: UNDERSTANDING HTML Tags VS Attributes. Element An element in HTML represents some kind of structure and generally consists of a start tag, content, and

Tag or Attribute

<body><hr>behavior= “…”direction= “…”height= “…”<font>…</font>width= “…”<marquee>…</marquee>

Page 8: UNDERSTANDING HTML Tags VS Attributes. Element An element in HTML represents some kind of structure and generally consists of a start tag, content, and

The answers…

<body><hr>behavior= “…”direction= “…”height= “…”<font>…</font>width= “…”<marquee>…</marquee>

Tags are green

Attributes are purple