-
AuthorPosts
-
October 6, 2015 at 7:24 am #613004
I have four columns in a row within a section on homepage here. Each column contains an image and sub-title (see first screen grab)
When this is resized down and breaches the mobile media query size, it reflows to a single column, which is excessive.
I’d like it to resize so that I get two ‘rows’ of two columns, rather than 4 rows of 1 column. I’m using cornerstone so how would I achieve this?
October 6, 2015 at 8:03 am #613052Hi,
Thanks for writing in!
To achieve that, you can add this under Custom > CSS in the Customizer.
@media (max-width: 767px) { body #housescores .x-column.x-sm, body #accreditations .x-column.x-sm { width:44% display:inline-block; } body #housescores, body #accreditations { text-align:center; } }
Hope that helps.
October 7, 2015 at 7:05 am #614777Hmmmm. Doesn’t appear to be working at >767px.
Have you assumed i’ve created the columns in a certain way or did you test that css live at your end?
October 7, 2015 at 7:12 am #614793Hi There,
Upon checking your website, I can see that it’s under construction.
In this case, would you mind providing us with your admin account so we can take a closer look?
Don’t forget to select Set as a private reply. This ensures your information is only visible to our staff.
Thanks.
October 8, 2015 at 9:12 am #616654Sorry! It’s live now!
October 8, 2015 at 11:23 am #616832Hi there,
My apologies as I left out a closing ; to one line of CSS in the previous code given, that’s why it does not appear to working. Kindly use this code instead:
@media (max-width: 767px) { body #housescores .x-column.x-sm, body #accreditations .x-column.x-sm { width: 44%; display: inline-block; } body #housescores, body #accreditations { text-align: center; } } /* Shows the blocks in 1 row in smaller screens - remove if you don't need this */ @media (max-width: 380px) { body #housescores .x-column.x-sm, body #accreditations .x-column.x-sm { width: 98%; display: inline-block; } }
I have tested this code and the current view collapses from 4 columns to 1 column at screen width of 767px and below so we have to define the CSS to set the row to fit 2 blocks in 1 row. The block of CSS at the bottom part is for smaller screen devices to show the boxes individually in each row so they do not show to close to each other. If you want to show them into 2 rows all throughout, you can removed the CSS block for 380px and below devices.
Hope this helps.
-
AuthorPosts