Tags and Attributes

HTML Tags

    HTML tags are keywords (tag names) surrounded by angle brackets

<tagname>content</tagname>
  • 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, but with a slash before the tag name

HTML Attributes
  • HTML tag 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"

For Example,

<body title="About Company">

Add some body content....

<a href="http://www.somesite.net" target="_blank"> Link Text </a>

</body>

          Here, title, href and target are attributes specifying title of the paragraph  and                                          hyperlink reference and target window of anchor tag.

No comments:

Post a Comment