Get Certified on your expert knowledge

Brainbench grant you full access to assessments and certifications covering over 600 skills in demand for today's marketplace.
Visit the site and get certified. Click Here to take some FREE tests.

Wednesday, May 30, 2012

Block vs Inline elements

characteristics of block elements include:
  1. Always begin on a new line
  2. Height, line-height and top and bottom margins can be manipulated
  3. Width defaults to 100% of their containing element, unless a width is specified
Examples of block elements include <div>, <p>, <h1>, <form>, <ul> and <li>. 

Inline elements on the other hand have the opposite characteristics:
  1. Begin on the same line
  2. Height, line-height and top and bottom margins can't be changed
  3. Width is as long as the text/image and can't be manipulated.
Examples of inline elements include <span>, <a>, <label>, <input>, <img>, <strong> and <em>.

To change an element's status you can use display: inline or display: block.

No comments:

Post a Comment