Tags, Attributes and Elements
HTML Tags:
HTML markup tags are usually called HTML tags.
- HTML tags are keywords (tag names) surrounded by angle brackets like <html>
- HTML tags normally come in pairs like <p> and </p>
- The first tag in a pair is the start tag, the second tag is the end tag
- The end tag is written like the start tag, with a slash before the tag name
- Start and end tags are also called opening tags and closing tags
Syntax : <tag name> Content </tag name>
Html Attributes:
- Attributes provide additional information about HTML elements.
- HTML elements can have attributes
- Attributes provide additional information about an element
- Attributes are always specified in the start tag
- Attributes come in name/value pairs like: name="value"
Example:
HTML links are defined with the <a> tag. The link address is specified in the href attribute: <a href="d:\html\images.html">This is a link</a>
Html Elements :
HTML documents are defined by HTML elements. Elements are the bits that make up web pages. An HTML element is everything from the start tag to the end tag. The start tag is often called the opening tag. The end tag is often called the closing tag.
Syntax
<opening tag> element content <closing tag>
<opening tag> element content <closing tag>
Example
“<title>” and “</title>” are tags,
“<title>HTML</title>” is a title element.
“<title>” and “</title>” are tags,
“<title>HTML</title>” is a title element.
Start tag | Element content | End tag |
<p> | This is a paragraph | </p> |
<a href="default.htm"> | This is a link | </a> |
<br> |
|
|