CSS Layout
Next ❯CSS Position
Used to control the layout of the element
- turned_in_notLayout Related Properties
- display
- visibility
- The default display value for most elements is
blockorinline
Display content
The above element takes full available width & starts on a new line
h1 {
display: block;
border: 2px solid teal;
}Displaysubject
Displayclose
<!DOCTYPE html>
<html>
<head>
<title>Full CSS Code</title>
<style>
h1 {
display: block;
border: 2px solid teal;
}
</style>
</head>
<body>
<h1>Display content</h1>
</body>
</html>- label_outlineTryout more
Properties Values display:
- label_outlineMore Display property values
Values Discription flex Displays an element as a block-level flex container inline-flex Displays an element as an inline-level flex container grid Displays an element as a block-level grid container inline-grid Displays an element as an inline-level grid container inline-table Displays an element as an inline-level table list-item Displays an element like a <li>elementtable Displays an element like a <table>elementtable-caption Displays an element like a <caption>elementtable-column-group Displays an element like a <colgroup>elementtable-header-group Displays an element like a <thead>elementtable-footer-group Displays an element like a <tfoot>elementtable-row-group Displays an element like a <tbody>elementtable-cell Displays an element like a <td>elementtable-column Displays an element like a <col>elementtable-row Displays an element like a <tr>element
Check content 1
Check content 2
Check content 3
The above content 2 is visible
visibility: |
#content2 {
visibility: visible;
}
h1{
text-align: center;
border: 2px solid teal;
}visibilitysubject
visibilityclose
<!DOCTYPE html>
<html>
<head>
<title>Full CSS Code</title>
<style>
#content2 {
visibility: visible;
}
h1{
text-align: center;
border: 2px solid teal;
}
</style>
</head>
<body>
<h1>Check content 1</h1>
<h1 id="content2">Check content 2</h1>
<h1>Check content 3</h1>
</body>
</html>❮ Prev CSS Table
Next ❯CSS Position






So,