Best way to: background "stripe" at 100% wide while inner div is content-width?
Here is an example of what I mean: IMAGE
The photo at the top is full-width as are the little "bars" that stick out the sides of the content, but they all have to line up with the content they are paired with... in the case of the first blue bar (at the top edge of the main photo) the general concept is fairly simple, like a full-width div with a content-width div inside of it, but some of the other ones are kind of confusing, like the ones that outline the "previous" and "next" arrow buttons on the carousels.
Is there a "best practice" for making these kind of bars work and position properly?
Thanks in advance for any help or advice.
I think there are a few ways you can do it.
You can use "position: absolute" to hover the boxes over the bars. While also using to "top, bottom, left, right" attributes in css.
You can also use a negative margin to shift a div on top of another div.
You could make the bar a background image. Although you want to try to limit the amount of images you load, which is why it's better to use css instead if it's a flat colored bar.
I have done this in one of my application.
Below is the example code and it has worked fine for me:
<div class="span-8">Column 1</div>
<div class="span-8">Column 2</div>
<div class="span-8 last">Column 3</div>
<div class="span-12">Body goes here</div>
<div class="span-12 last">Some sort of menu perhaps</div>
Then you style .stripeContainer:
width: 100%; /* this is usually implied */
For stripe you can follow up with the below link:
Hope this helps.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)