Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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
    Elena

    #1198875

    Hey 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”
    2020-03-29_111442.png
    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,
    Mike

    #1201935

    Dear 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,
    Elena

    #1202237

    Hi,
    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,
    Mike

    #1202599

    Hi 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,
    Elena

    #1202641

    Hi,
    Glad to hear, shall we close this then?

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.