Changing How an Element is Displayed
Example
Example
Changing an inline element to a block element, or vice versa, can be useful for making the page look a specific way, and still follow web standards.
The following example displays list items as inline elements:
Example
li {display:inline;}
The following example displays span elements as block elements:
Example
span {display:block;}
Note: Changing the display type of an element changes only how the element is displayed, NOT what kind of element it is. For example: An inline element set to display:block is not allowed to have a block element nested inside of it.
No comments:
Post a Comment