Andy 0

Hullo,

I'm in no ways a CSS/web guru, and would appreciate some thoughts on the best approach for my situation. I'm developing a site in Drupal that displays adverts. I'd like one particular advert slot to take up the full width of the right-hand sidebar at the top; however on my first trial the ad overflowed because it was a child of the sidebar-right-inner class which has padding and margins to make everything look nice. I see two ways to avoid this problem, neither of which is ideal.

  1. I can use relative positioning for the ad, to move it where it should be. This is very quick, but a bit naff because I need to update the ad's positioning if I change the sidebar's margin or padding.
  2. I can modify my theme to have a new region that's in the correct part of the hierarchy, and move the ad block into that region. The end result here feels nicer, but it's a bit of effort, and doesn't help me if (say) I want another full-width ad halfway down the sidebar.

Is there another (nicer) way I've missed? Are there (dis)advantages I've missed? It's not a show-stopper, just wanted to hear folks' thoughts.

Thanks,

Andy

1 answer

roobin 5
0
points

Not sure that it's nicer, but you could try negative margins as in: margin-left:-15px; or margin: 0 -15px 0 -15px;

Answered over 6 years ago by roobin
  • Thanks, yeah, that's what I was thinking for 'solution' number 1 - the problem is that it makes rejigging the margins/padding of the container that much more involved. Andy over 6 years ago