Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Display notes #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions css/css-display.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
CSS *display* property specifies the display behavior (the type of rendering box) of an element.

There are different properties for setting the display of an element:

*inline* displays an element as an *inline* element (like <span>). Any height and width properties will have no effect

*block* displays an element as a *block* element (like <p>). It starts on a new line, and takes up the whole width

*contents* makes the container disappear, making the child elements children of the element the next level up in the
DOM

*flex* displays an element as a *block-level flex container*

*grid* displays an element as a *block-level grid container*

*inline-block* displays an element as an *inline-level block container*. The element itself is formatted as an inline
element, but you can apply height and width values

*inline-flex* displays an element as an *inline-level flex container*

*inline-grid* displays an element as an *inline-level grid container*

*inline-table* the element is displayed as an *inline-level table*

*list-item* the element will behave like a *<li>* element

*run-in* displays an element as either block or inline, depending on context

*table* the element will behave ike a *<table>* element

*table-caption* the element will behave like a *<caption>* element

*table-column-group* the element will behave like a *<colgroup>* element

*table-header-group* the element will behave like a *<thead>* element

*table-footer-group* the element will behave like a *<tfoot>* element

*table-row-group* the element will behave like a *<tbody>* element

*table-cell* the element will behave like a *<td>* element

*table-column* the element will behave like a *<col>* element

*table-row* the element behave like a *<tr>* element

*none* the element is completely removed

*initial* sets this property to its default value

*inherit* inherits this property from its parent element

How to use the *display* property in your css class:
display: value;