HTML Attribute, Heading, Paragraph

Posted: June 6, 2012 by makaranddalal in HTML

HTML Attributes

  • Attributes are modifiers of html elements which provides additional information about them.
  • Attributes generally appear in name-value pairs, separated by “=”.
  • Attributes are written within the start tag of elements.

Syntax: <tag attribute=”value“>(content which should be modified by the tag)</tag>Example: <a href=””> Engineering adda </a>

  • Here link address is specified in href attribute.
  • The value may be enclosed in single or double quotes. Attribute values should always be enclosed in quotes.

Some attributes:

  • class: Specifies one or more class names for an element.
  • id: Specifies an unique id for an element.
  • style: Specifies an inline CSS style for an element.
  • title: Specifies extra information about an element.
  • accesskey: Specifies a shortcut key to activate/focus an element.
  • tabindex: Specifies tabbing order of an element

HTML Headings

  • Headings are defined with tags <h1> to <h6>
  • Most important one is <h1>, then <h2>, then <h3>
  • <h4> to <h6> are mostly not used as it doesn’t have much importance for Search-engines.
  • Search-engines use your headings to index the structure and content of your document/web-pages.
  •  It is important to use headings to show the document structure.

Page headings:

  1. Only one h1 per page – it should define the one overall topic of the current page
  2. All subheadings are h2,h3, etc

Site headings:

  1. On the homepage the site name is in h1
  2. On a section/index page the site name becomes a strong/bold, and the section name is h1
  3. On a content page the article title is h1 and the site and section name are both strong

HTML Lines

  • Uses <hr> tag
  • Creates an horizontal line
  • Normally use to separate content

HTML Comments

  • Comments can be inserted into html document to make code easily understandable to users other then the developer
  • Content written under comment tag is hidden and not visible in output

HTML Paragraphs

  • Documents in html are divided into paragraphs
  • They are defined with the <p> tag
  • Browser ignores Layout
  • Browser ignores lot of lines
  • Browser ignores space
Number of lines in a paragraph depends on a browser window, if you re-size the browser window, the number of lines in this paragraph will change.

HTML Line Breaks

  • <br> tag can be used to break line in html without starting a new paragraph
  • We can also use the <br /> tag

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s