-
AuthorPosts
-
December 6, 2019 at 4:13 pm #1163411
Hi,
do you have a css code for me that allows me to display 2 columns on tablets.
I have 6 columns in two rows. The columns should be displayed in this way.
desktop
[] [] []
[] [] []
tablet
[] []
[] []
[] []
mobile
[]
[]
[]
[]
[]
[]
Currently only 3 or 1 column can be displayed on tablet.Thanks
Best regards,
artiDecember 6, 2019 at 10:48 pm #1163487Hey SW-online,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
BasilisDecember 7, 2019 at 12:09 am #1163495Well best would be to ignore Enfold Settings and play a bit with flexbox layout.
on my testpage you see on top the flexbox – and in the grey color-section this is columns declaration on default.
i gave to the top color-section a custom-class of: three-two-one :lol
the top columns ( i take 1/3 – but this is not important ) – but take individual height pleaseTo play a bit with justify-content it would be nice to only have columns in that container and no :before and :after pseudo elements
(thats the first rule)
Put this to quick css then:.three-two-one .entry-content-wrapper:before, .three-two-one .entry-content-wrapper::after{ display: none; } .three-two-one .entry-content-wrapper { display: flex; flex-flow: row wrap; justify-content: space-between; align-items: stretch } .three-two-one .entry-content-wrapper .flex_column { flex: 0 1 28%; margin:0; padding: 0; margin-bottom: 3% } /**** your tablet definitions - play with the values as you like ***/ @media only screen and (min-width: 768px) and (max-width: 989px) { .three-two-one .entry-content-wrapper .flex_column { flex: 0 1 47%; } } /*** this is not necessary because on that screen-width the Enfold default is 100% ***/ @media only screen and (max-width: 767px) { .three-two-one .entry-content-wrapper .flex_column { flex: 0 1 100%; } }
you can see here the test page: https://webers-testseite.de/3columns/
_____
here a nice overview to flexbox layout: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
here a playground to get a feeling on what could be done ( sorry this is german page – but you can play with checkboxes on bottom ) : https://www.mediaevent.de/css/display-flex.htmlon the last link for example see the part with : justify-content.
now you see why i do no want to have before and after containers in it – these would be handled like flex items .
The align-items : stretch results in “equal height containers” etc.A really might “tool” – isn’t it ?
December 7, 2019 at 12:21 am #1163497on my test page i took a different screen-width range.
/**** your tablet definitions - play with the values as you like ***/ @media only screen and (min-width: 600px) and (max-width: 989px) { .three-two-one .entry-content-wrapper .flex_column { flex: 0 1 47%; } } /*** this is not necessary because on that screen-width the Enfold default is 100% ***/ @media only screen and (max-width: 599px) { .three-two-one .entry-content-wrapper .flex_column { flex: 0 1 100%; } }
you decide what looks best for your page
All new browser can do that – but if you like to have a better browser coverage – see here: https://kriesi.at/support/topic/browser-specific-css/December 7, 2019 at 9:00 am #1163547and here you see next advantage – the columns “width” 1/3 has no influence – what do you think would happen if i declare this for large screens?
@media only screen and (min-width:1800px) { .three-two-one .entry-content-wrapper .flex_column { flex: 0 1 15%; } }
December 7, 2019 at 1:45 pm #1163568Hallo Guenni,
du bist mein Held! Es funktioniert jetzt perfekt!
Vielen Dank und liebe Grüße
artiDecember 7, 2019 at 2:31 pm #1163572Bitte – gern geschehen.
Das kann man natürlich auch auf andere Elemente von Enfold übertragen. Iconboxes etc. pp
Immer wenn gleiche Elemente auftauchen, die in einem gemeinsamen Elternelement stecken.
Gilt zB auch für Listenpunkte – oder Hauptmenu Navigations Punkte.
Bis dannJanuary 13, 2020 at 2:25 pm #1172792This reply has been marked as private. -
AuthorPosts
- The topic ‘desktop 3 columns > tablet 2 columns > mobile 1 column’ is closed to new replies.