Tagged: 1/3 column, center column
-
AuthorPosts
-
March 21, 2023 at 5:26 pm #1401930
hey there,
i would like to keep 2 small columns and center them.
I gave an Id to my color section and this code, but it does not work. Perhaps you have a solution for me?
`#av-center-align-columns .entry-content-wrapper {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
justify-content: center;
}March 22, 2023 at 3:42 am #1401970Hey Monika,
Thank you for the inquiry.
Have you tried placing another 1/4 column on both sides of the existing columns? This should align the first two columns in the center without using additional css.
Best regards,
IsmaelMarch 22, 2023 at 10:04 am #1401984thank you for your answer.
If the two columns could be very small it would be ok but i want them to be minimum 1/3 width.
How can i center them both?March 22, 2023 at 10:38 am #1401987Hi Monika,
The ID is not set on the Color Section, try to add this CSS code:
.page-id-20 #av_section_5 .flex_column_table { display: flex; gap: 4%; justify-content: center; } .page-id-20 #av_section_5 .flex_column_table .flex_column { display: block; width: 33%; margin-left: 0; } .page-id-20 #av_section_5 .flex_column_table .av-flex-placeholder { display: none; }
Best regards,
NikkoMarch 22, 2023 at 10:46 am #1401991Great!! Thank you Nikko,
that worked.I have already a background css class given to that section so I wanted to adress centered Column section by ID.
But now I’m confused.
Why does this work, in this specific class even tough i havent given it any class name like “page-id-20”??
Why is it just working for this class and not for all?
I will need this column styling for other pages too. so where can i tell an other color section to be also centered?Thanks!
MonikaMarch 23, 2023 at 6:20 am #1402078Hi Monika,
You’re welcome :)
By default, the body of the page has a class of page-id-ID, so when you use this CSS selector .page-id-20 it will only target the page with that ID number.
Also, Color Sections ID are auto-generated if you don’t set one, so if you don’t put one then it will automatically have the id of #av_section_1 and then increments in every Color Section. Also, Custom IDs are good idea if you only have one on the page since it’s supposed to be unique, if you use this layout twice in a single page then use Custom CSS Class instead of Custom ID Attribute. So what I suggest instead is to use a Custom CSS Class, let’s just name it center-columns (add this on each Color Section) and replace the code I gave you with:#top .center-columns .flex_column_table { display: flex; gap: 4%; justify-content: center; } #top .center-columns .flex_column_table .flex_column { display: block; width: 33%; margin-left: 0; } #top .center-columns .flex_column_table .av-flex-placeholder { display: none; }
Hope this helps.
Best regards,
NikkoMay 24, 2023 at 3:03 am #1408348Nikko,
Your final solution also worked exceedingly well for my StructInt.com website and the many webpages where we needed two 1/3 elements centered.
Thank you!
All the Best,
NathanMay 24, 2023 at 3:20 am #1408354Hi Nathan,
I’m very happy to hear that!
Thanks for your kind feedback and thank you for using Enfold. :)Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.