Monday, 20 January 2014

A Complete HTML Guide And Tutorial For Beginner And Newbie Part 3

HEADING TAG

  • The Heading tags are h1, h2, h3, h4, h5 and h6.
  • The h1 tag is only used once, as the main heading of the page. h2 to h6, however, can be used as often as desired, but they should always be used in order, as they were intended. For example, an h4 should be a sub-heading of an h3, which should be a sub-heading of an h2.
  1. <!DOCTYPE html> 
  2. <html> 
  3. <head> 
  4. <title>My first web page</title> 
  5. </head> 
  6. <body> 
  7. <h1>My first web page</h1> 
  8. <h2>Ash Paulzz</h2> 
  9. <p>My best wapka friend </p> 
  10. <h2>Why this is</h2> 
  11. <p>To learn HTML</p> 
  12. </body> 
  13. </html>

ATTRIBUTE TAG

  • Tags can also have attributes, which are extra bits of information. Attributes appear inside the opening tag and their values sit inside quotation marks. They look something like <tag attribute="value">Margarine</tag>
  • Attributes are always written within a start tag and are followed by an equals sign and the attribute details written between inverted commas. The semicolon after the attribute is for separating different style commands.
  1. <h2 style="background-color:#ff0000;">Ash is a Good boy and adgamma is a bad boy</h2>

LINK TAG

  • An anchor tag <a> is used to define a link.

  1. <a href="http://www.blogwritter.com">Blogwritter.com</a>

  • The destination of the link is defined in the href attribute of the tag. The link can be absolute, such as “http://www.blogwritter.com”, or it can be relative to the current page. So if, for example, you had another file called “test.html” in the same directory then the line of code would simply be <a href="test.html">Title</a> or something like this. Ex:
  1. <a href="page2.htm">Click here to go to page 2</a>
  2. <a href="subfolder/page2.htm">Click here to go to page 2</a>
  3. <a href="../page1.htm">A link to page 1</a>

No comments :

Post a Comment