
Tagged: grid color
-
AuthorPosts
-
August 1, 2025 at 7:34 am #1487447
I have a grid in the content area of this page:
https://yu39su8np7.papa-view.com/
It mostly behaves the way I want it to. But I don’t understand why the color behind the grid is correct, but the color to left and right of grid is not the content area color.
August 1, 2025 at 9:24 am #1487450you have set this css rule to not have the full-width of the grid element.
#av-grid-custom-home { max-width: 960px; margin: 0 auto; }
the quick and dirty way is to set the background-color to your #f3f3f3 – but it influences the whole installation.
#top #main { background-color: #f3f3f3; }
__________________
so remove your setting from above …
A more flexible approach is to wrap the grid-row element in a div that has all the properties of a standard color-section.
set a custom class on those grid-row element : grid-notfull
now to get a not fullsize grid-row element i have the following snippet in my child-theme functions.php :function grid_layout_notfull(){ $responsive_size = avia_get_option('responsive_size'); ?> <script> (function($){ $('.av-layout-grid-container.grid-notfull' ).each(function() { var notfullID = $(this).attr('id'); $(this).hasClass('main_color') ? $(this).wrap('<div class="main_color notfullsize '+notfullID+'"></div>') : ''; $(this).hasClass('alternate_color') ? $(this).wrap( '<div class="alternate_color notfullsize '+notfullID+'"></div>') : ''; }); $('.notfullsize').css({"clear": "both", "width": "100%" , "float": "left" , "position": "static" , "min-height": "100px" }); $('.grid-notfull').css({"max-width": "<?php echo $responsive_size; ?>" , "margin": "0 auto" , "padding": "0 50px"}); })(jQuery); </script> <?php } add_action('wp_footer', 'grid_layout_notfull');
August 1, 2025 at 9:36 pm #1487478I understand that this may be the only way to accomplish what I want, but I was hoping for something that would only use CSS.
Before I use your suggestion, I should mention that until last night, the I had the stuff that is now in grids in 3 columns instead. Each column had a text block and an image block. It looked great in a pretty wide opened browser window on a monitor, but when I narrowed the window, of course each text block wrapped the text at a different point, which pushed the image below it down.
I tried to figure out a way to keep all three text blocks the same height when they started to wrap. When I couldn’t accomplish that, I put that stuff into grids. So that caused a different issue. And with the grids, the image fills the whole space whereas in the columns the image stayed at 215px wide max.
I don’t think there will be any issue with setting the background color across the whole site. This is a VERY small site and I’m trying to keep it VERY simple since I will not be maintaining it eventually. Or I could probably add the post number to the CSS to make it just affect that page like I did with some other CSS? If the site was going to have 1,000 pages, that would not be a great solution. But that’s not the case.
-
AuthorPosts
- You must be logged in to reply to this topic.