-
AuthorPosts
-
February 27, 2020 at 11:46 am #1188400
Hi,
I am trying to change the background color of the left sidebar to a light grey color. I tried to follow the code from here: https://kriesi.at/support/topic/sidebar-background-colour/ , but the sidebar ended up overlapping the main content.
I hope you can help!
Best regards,
SusanneFebruary 27, 2020 at 9:13 pm #1188636Hey Telmore,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaFebruary 28, 2020 at 9:31 am #1188784This reply has been marked as private.February 29, 2020 at 11:56 pm #1189116Hi,
Thank you for the login, I see this is not a true sidebar and is a 1/4 column, which is fine, but will this also be on other pages or only on this one? If you add this to other pages please add a custom class to them all so the same css with work on all of them.
I see that some of your other pages have a true sidebar, do you want the background color changed for those too?
For the page you linked to, Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:#main > div > div.flex_cell.no_margin.av_one_fourth { background-color: #dddddd; }
After applying the css, Please clear your browser cache and check.
Best regards,
MikeMarch 2, 2020 at 10:11 am #1189378Hi Mike,
Yes, I think I accidentally came to change the sidebar to a column for the page I linked to. I have changed it back to an actual sidebar. It is the true sidebar I want to change the background color of.
Best regards,
SusanneMarch 4, 2020 at 12:50 pm #1190033Hi,
Sorry for the late reply, Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:#main > div.main_color.container_wrap_first.container_wrap.sidebar_left > div { background-color: gray; } #main > div.main_color.container_wrap_first.container_wrap.sidebar_left > div > main { background-color: #fff !important; }
After applying the css, Please clear your browser cache and check the url in the Private Content area.
Best regards,
MikeMarch 6, 2020 at 2:53 pm #1190886Hi Mike,
It works like a charm!Thanks for the help :)
Best regards,
SusanneMarch 6, 2020 at 4:09 pm #1190908HELLO MIKE : please change your image-hoster – it is horrible
popups and other nefarious sites as they all open up – not always – but more and more often. Also the Kriesi page will be closed etc. pp.
Please!________
On Ismaels code i see there was a little inconsitency: if there is a color-section with background-image on top – like here f.e:
https://kriesi.at/themes/enfold-2017/blog/blog-single-author-small/ his code will end in a colorized top color-section too:
So we can use an attribute selector – only if there was no background-image on container.wrap the code will do the job:@media only screen and (min-width: 768px) { .container_wrap.sidebar_right:not([style*="background-image"]):before { content: ''; display: block; position: absolute; right: 0; top: 0; background: #ddd; height: 100%; width: calc(30%); } }
if you got sidebar left the change it to: .container_wrap.sidebar_left.
March 6, 2020 at 11:27 pm #1191025Hi,
@Guenni007 thanks for letting me know about the popups, I’ll look for a new image host.
Also thanks for the updated css.Best regards,
MikeMarch 9, 2020 at 11:59 am #1191443Hi Mike,
Sorry, there still seem to be an issue with the background color of the sidebar. In the attached image you can see that it is only a part of the sidebar that have gained the grey color. I would like the whole sitebar to be grey.
Best regards,
SusanneMarch 11, 2020 at 10:43 am #1192188Hi,
Thank you for the screenshot, the white area to the left of your sidebar is the background of the page, your page has a max-width of 1610px, so on screens above that the page background is seen typically evenly on both sides.
so you could go to Enfold Theme Options > General Layout > Dimensions and change your max-width
or you could use this css to change the background color of the background, but on very large screens the background may also show on the far right side:#main > div.main_color.container_wrap_first.container_wrap.sidebar_left > div,#main > div.main_color.container_wrap_first.container_wrap.sidebar_left { background-color: lightgray; }
Best regards,
MikeMarch 11, 2020 at 1:15 pm #1192252Hi Mike,
Thank you! It worked perfectly :)
Best regards,
SusanneMarch 11, 2020 at 5:03 pm #1192357Hi Susanne,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
VictoriaMarch 11, 2020 at 11:49 pm #1192432with the code of ismael mentioned here: Link
and my little added selector
the whole sidebar is colorized ( till footer) : ( you have only to adjust the percentage to your enfold width options.
March 12, 2020 at 6:07 am #1192501March 15, 2020 at 4:16 pm #1193235Yes but – it is not quiet easy as i thought first:
if this is the setting: https://kriesi.at/support/topic/change-bacground-color-of-sidebar/#post-1192188
we have for the content: 1310px because of left right padding of 50px.
for the : template-page content it is : 956,3px (73% of 1310px)
and for aside : 353,7px (27% of 1310px) but this ends on the right side without padding – if you want to colorize it looks better if you do a “pseudo padding” more background as the width of it is f.e. the 50px
…hope you all will understand the calculations with the given comments:
/**** just for that example page ***** don't know why there is container set to 95% ***** so i first set it to 100% because it is better to understand ***** and 1410px with 50px padding left and right ***** so template width is 1310px - content is 73% of that - aside ist 27% ***** ****/ .container { width: 100% !important; } @media only screen and (min-width: 1410px) { .container_wrap.sidebar_right:not([style*="background-image"]):before { content: ''; display: block; position: absolute; left: calc(50vw + 0.23*1310px); top: 0; background: #ddd; height: 100%; width: calc(0.27*1310px + 50px); /** 27% of 1310px + 50px ** looks better **/ } } /** in case it should cover the whole background from aside start to screen width end @media only screen and (min-width: 1410px) { .container_wrap.sidebar_right:not([style*="background-image"]):before { content: ''; display: block; position: absolute; left: calc(50vw + 0.23*1310px); top: 0; background: #ddd; height: 100%; width: calc(50vw - 0.23*1310px); } } ***/ @media only screen and (max-width: 1409px) { .container_wrap.sidebar_right:not([style*="background-image"]):before { content: ''; display: block; position: absolute; right: 0 ; top: 0; background: #ddd; height: 100%; width: calc(0.27*(100vw - 100px) + 50px) } } @media only screen and (max-width: 767px) { .container_wrap.sidebar_right:not([style*="background-image"]):before { display: none } }
March 15, 2020 at 5:06 pm #1193239 -
AuthorPosts
- You must be logged in to reply to this topic.