Home Page DOM Tutorials display values |
There are many possible values for display, but the three most important are none, block, and inline. As we mentioned before, setting display to none takes an element out of the page flow entirely; the browser ignores it. The last two of these refer to the context in which HTML displays elements. block elements begin on a new line. Examples are <h1>, <p>, <ol>, and <div>. inline elements are laid out one after the other and flow in line with their surrounding elements. Examples are <b>, <i> and <span>
By changing display appropriately, we can cause a <div> to appear in any of these formatting contexts. Here's an example:
The display property | Expanding Text |