To enable pages to be responsive, they use css flexboxes or css grids. These enable panels to be created in a tabular layout that automatically adjust to various page widths.
The css that generate these has been revised and renamed to provide greater flexibility and ease of transfer between layouts.
In both cases the above styles should be followed with a style to indicate how many columns are required. The available column styles are: .col1, .col2, .col3, .col4, col5, .col6 .col7 or col7.
Basically not much but…
For the purposes of this wiki page, examples will be based on the template1 page which contains many examples of Flexbox elements.
The panel on the right shows the 3 column layout page. The image is what that section would look like.
The following styles are available when you use flexboxes.
ows-fixed:This class prevents orphan panels stretching across the available screen width.
ows-growX2:Adding this class as well as .ows-fixed will enable you to expand the panel to twice its default width Note
ows-growX3:As above but multiplies the width by three - the same limitations apply.
ows-growX4:Multiplyes the width by four.
ax-titleBar: This creates a non-wrapping row with space justified. ax-btnBar: This creates a wrapping row(s) with varying size content that spills onto additional rows if required. Content will be justified. ax-dataBar: This is similar to the ax-titleBar but adds a hovering highlight to each row.
<h3>Three Column Layout</h3> <div class="ows-flex col3 ows-fixed"><!-- ows-fixed stops orphan panels stretching across the page --> <div class="w3-card w3-border ows-theme1-bdr" style="order:1;"> <div class="ows-titleFlex ows-theme7"> <h3>Title</h3> <p>Tag</p> </div> <p>Some text below the title.</p> </div> <div class="w3-card w3-border ows-theme2-bdr ows-theme-shadow2-hvr" style="order:2;"> <p>A card just containing texr</p> </div> <div class="w3-card w3-border ows-theme3-bdr" style="order:3;"> <p>Unlike the two columnn set to a fixed width - 'ows-fixed', so the orphan columns below stay 'column' width. They also center.</p> </div> <div class="w3-card w3-border ows-theme4-bdr" style="order:0;"><!-- This card will be first in the set --> <div class="w3-flex ows-btnBar"> <p>Click me:</p> <button class="w3-button ows-theme3-bkg-hvr">This is a button</button> </div> </div> <div class="w3-card ows-theme9 ows-growX2"> <p>This column is a card. It has also been set to grow to twice its width - 'ows-growX2'.</p> <p> The card before it has a button bar - ows-btnBar' with some text and a button. Not only the button stretches to fill the availabel space, this makes it easy to place text beside the button if required. Text can be put infront of, or after the text - </p> </div> </div>
The code panel shows a three column grid layout. The image below shows what it looks like.
There are no unique styles that can only be used with grids - one of the reasons that are used.
<h4>A three column grid layout</h4>
<div class="ows-grid col4">
<div class="w3-container w3-border ows-theme9">
<div class="ows-titleFlex ows-theme7 w3-stretch">
<h3>Title</h3>
<p>Tag</p>
</div>
<p>Card</p>
</div>
<div class="w3-container w3-border ows-theme9 ows-theme2-bdr"><p>Card</p></div>
<div class="w3-container w3-border ows-theme3-bdr"><p>Card</p></div>
<div class="w3-container w3-border ows-theme4-bdr"></div>
<div class="w3-container w3-border ows-theme7 ows-theme3-bdr">
<p>
As this is an orphan panel in a grid layout it always retains the panel size.
</p>
</div>
</div>
As can be seen in the snippets of code above or by looking at either of the template pages, there are a number of other classes that can be applied to aid the development of your own pages.
This creates a flexbox title bar with all content aligned to the baseline. It can contain as many elements as will fit on a single line but it will not wrap content onto new rows. Each element has a 1 vertical width gap to ensure they won't touch adjacent elements. They add a margin below so that following content is appropriately spaced.
Note
This provides a framework for one or more buttons. It is a flexbox and will wrap buttons onto additional lines if required. It also correctly formats the buttons. Buttons are spaced as for the title bar.
Note
These two classes are provided to enable you to wrap rows of data so that they respond to mouse hovers. The Flex version allows for two columns, the righthand one being right aligned. The Row2c2) version has fixed second column width of 9em and is also right aligned.
There is also a special - ows-dataRow3C declared on the Today V Yesterday page that creates a three column layout specifically for the page.
Further Information
These are as included in the w3v5.css stylesheet. This version includes all the available w3c® colours. These are used by adding the class to the required element. They are in the format:
There are other hover colour effects available. For a full list visit: W3Schools.
For a full list of all the features supplied within the w3v5.css stylesheet visit: W3Schools