Responsive Grid Layers
The CSS Grid Layout Modules makes it possible to easliy layer responsive items with the minimum of code. Grid items can be positioned in a number of different ways. The method used here is perhaps the easiest to understand without having to learn CSS.
Items are placed horizontally by specifying the number of the "start" column and the number of columns spanned.
Items are placed vertically by specifying the number of the "start" row and the number of rows to span.
The examples above have 8 columns and 3 rows to illustrate horizontal overlapping. The one further down the page adds more rows to show how a vertical overlap can be created.
Horizontal Position
In the example above, the image starts at column 1 and spans 6 columns.
The text starts at column 5 and spans 3 columns.
Vertical Position
The image occupies all three rows so it starts at row 1 and spans 3 rows.
The text is in row 3 so it starts at row 3 and spans 1 row.
The text is an an HTML5 article element which can be aligned vertically within it's parent using the align-self selector set to start, center, end or auto. Auto stretches it to fill the height of the parent container. In this case it is set to "center".
Mobile Layout
Media queries are used to change the layout for mobile devices. The break point can be set for tablet landscape (1059px) or tablet portrait (799px).
In the example above, the image starts at column 1 and spans all 8 columns. It starts at row 1 and spans all 3 rows.
The text starts at column 1 and spans 8 columns.
It starts at row 3 and spans 1 row. The align-self proerty is set to "end" so that the text overlays the image at the bottom.
To move the text to the top, it would be set to start at row 1, span one row and have the align-self property set to "start".
Vertical Images
The widget allows two different sizes of image to be used. The large image displays when the page is viewed on computers and tablets and the small image when viewed on mobile phones.
Vertical Overlap
The items above have a horizontal overlap. Scroll down to see an example of vertical overlap …