Elements can be classified according to the way they’re displayed—inline or block. By default, every tag has a display style that defines how it will fit with the surrounding tags. You can use the display property to define whether an element includes line breaks above and below (block), is included with other elements without hard line breaks (inline), is treated as part of a list (list), or is displayed at all (none). To set an element’s display type:
1. Start your declaration by typing the display property name in the CSS declaration block, followed by a colon (:) display:
2. Type one of the display types; Choose a type depending on the desired result: inline flows the element horizontally and its siblings from left to right until the edge of the parent element is encountered, at which point a soft break is added wrapping the content to the next line. Hard line breaks immediately before and after the box are always suppressed. A block places a hard line break above and below the box, flowing the elements vertically. Setting this automatically forces the width of the box to the end.
| Class | Defines |
|---|---|
| w3-center | Centered content |
| w3-left | Floats an element to the left (float: left) |
| w3-right | Floats an element to the right (float: right) |
| w3-left-align | Left aligned text |
| w3-right-align | Right aligned text |
| w3-justify | Right and left aligned text |
| w3-circle | Circled content |
| w3-hide | Hidden content (display:none) |
| w3-show | Show content (display:block) |
| w3-show-block | Alias of w3-show (display:block) |
| w3-show-inline-block | Show content as inline-block (display:inline-block) |
| w3-top | Fixed content at the top of a page |
| w3-bottom | Fixed content at the bottom of a page |
| w3-display-container | Container for w3-display-classes (position: relative) |
| w3-display-topleft | Displays content at the top left corner of the w3-display-container |
| w3-display-topright | Displays content at the top right corner of the w3-display-container |
| w3-display-bottomleft | Displays content at the bottom left corner of the w3-display-container |
| w3-display-bottomright | Displays content at the bottom right corner of the w3-display-container |
| w3-display-left | Displays content to the left (middle left) of the w3-display-container |
| w3-display-right | Displays content to the right (middle right) of the w3-display-container |
| w3-display-middle | Displays content in the middle (center) of the w3-display-container |
| w3-display-topmiddle | Displays content at the top middle of the w3-display-container |
| w3-display-bottommiddle | Displays content at the bottom middle of the w3-display-container |
| w3-display-position | Displays content at a specified position in the w3-display-container |
| w3-display-hover | Displays content on hover inside the w3-display-container |