-
AuthorPosts
-
March 27, 2020 at 9:06 pm #1198431
Hallo,
I was wondering if there is any way to create an overlay over a background image in a column.
I have a color section with a black overlay at the bottom of the homepage, just above the footer, as you can see here https://elenagrassi.improntediluce.it/
I would like to create the same effect in this page https://elenagrassi.improntediluce.it/portfolio-articoli/educazione-consapevole-del-cane-2/ but since I want to have a sidebar in the page, as I understand I cannot use a color section.
Is there a way out of this impasse?
Thank you
ElenaMarch 29, 2020 at 5:47 pm #1198875Hey Elena,
Sorry for the late reply, this can be done by creating a div with the overlay under your text element.
The following code is to do this one your one page so you can see, but since you probably want to add this to many pages you will want to add a custom class to each of your columns that, such as “overlay-column”
Try adding this code to the end of your functions.php file in Appearance > Editor:function custom_overlay_script(){ ?> <script> (function($){ $(document).ready(function(){ $('#top.postid-564 .flex_column.avia-builder-el-33').prepend('<div id="overlay"></div>'); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_overlay_script');
to use this for other columns with the custom class above, just replace
#top.postid-564 .flex_column.avia-builder-el-33
with.overlay-column
Then add this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:#overlay { top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); position: absolute; z-index: -1; }
Best regards,
MikeApril 8, 2020 at 3:39 pm #1201935Dear Mike,
I just saw your reply today as for some reason I did not receive any e-mail message when you wrote your reply.
I have tried to do what you explain by using the overlay-column ccs style name. But it does not seem to have worked.
I may have done something wrong as I am not an expert. Also, the adds I made seem to have disruspted the breadcrumbs section for which I had done some customization before.
Can you take a look at what I did?
THank you,
ElenaApril 9, 2020 at 11:52 am #1202237Hi,
Thanks for the feedback, it looks like the overlay was added twice so it is darker than expected, please include an admin login in the Private Content area so we can adjust.
I also don’t see your breadcrumbs on your page or a post.Best regards,
MikeApril 10, 2020 at 7:59 am #1202599Hi Mike,
I realized I had pasted the code you gave me in the wrong position. That’s why the overlay didn’t work and the breadcrumbs too.
It is all there now, as you can see in this page https://elenagrassi.improntediluce.it/portfolio-articoli/educazione-consapevole-del-cane-2/
So you don’t need to investigate futher. Thank you very much,
ElenaApril 10, 2020 at 11:49 am #1202641 -
AuthorPosts
- You must be logged in to reply to this topic.