To implement different CSS rules for smaller and larger screens, you will need to provide specific instructions on how to display a col-18 element on smaller screens.
One approach is to customize the CSS file by adjusting the $grid-columns value in the _variables.scss file from 12 to 18. After compiling your custom CSS file, you can utilize Bootstrap's standard method to alter column behavior on smaller screens.
For example, with a 12-column grid, you could designate 12 (or 18) columns for large screens while defining the same columns as 2 or 3 wide for smaller screens, causing the second group of columns to wrap below the first on smaller screens.
If certain columns are not essential on smaller screens, another option is to hide them entirely.
Below is a simple demonstration of wrapping or hiding columns using a 12-column grid:
.row-1 p {
background-color: lavender;
}
.row-2 p {
background-color: lightpink;
}
p {
text-align: center;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="06646969727572746776463228332835">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a8cac7c7dcdbdcdac9d8e89c869d869b">[email protected]</a>/dist/js/bootstrap.bundle.min.js"></script>
... (additional code provided)
An alternative method is to stick to the standard grid layout and specify three columns for widescreen displays, then assign each column 6 columns (3 * 6 = 18). These three columns would expand to full screen width on smaller screens.