...

View Full Version : make left and right floated images bleed off screen



surreal5335
11-08-2012, 05:19 PM
I have 3 main elements a main column with content, an image that butts up against on the left side and an image butts up against it on the right side.

When I view this layout in a large screen it looks good, but on a small screen these elements overlap and pushed into a vertical layout of one column.

Since the two side images are purely asthetic, how could I go about having the two side images bleed off the screen when the there is not enough room for them and main column to all lay side by side.

I thought about using background images for my side images but that would make butting them up against the main column very problematic.

Using position absolute would yield similar results as a background image setup.

Any ideas?

Excavator
11-08-2012, 05:26 PM
Hello surreal5335,
If you put all three main elements into a centered containing element, you would be able to stop that float drop.

surreal5335
11-09-2012, 06:18 PM
Thanks for the reply,

Thats the setup I have now, I guess I should have included the code, sorry about that

HTML


<div class="body_wrapper">
<div class="left_bar">
<img src="images/Derp_Left.jpg">
</div>
<div class="main_container">
<b>
<b>
<div class="right_bar">
<img src="images/Derp_Right.jpg">
</div>
</b>
</b>
</div>

*note: I certianly did not put in the <b> tags that appeared on its own, suggestions on how to fix this are greatly appreciated


CSS


.body_wrapper {
margin: 0 auto;
min-width: 1400px;
width: 90%;
}

.left_bar {
float: left;
width: 20%;
}

.left_bar img, .right_bar img {
width: 100%;
}

.main_container {
background-color: #221100;
float: left;
min-width: 960px;
padding: 0 0 20px;
width: 55%;
}

.right_bar {
float: left;
width: 20%;
}


I have been reading about responsive grid to make the content fit better across screens. My only concern is that the two side images may be too big or too small in comparision to the main container when its on the small screen (like 14") in order to make it fit.

I would prefer that all three elements dont scale or size down in the small screen, just the side columns bleed off the edge of each side when the screen gets too small leaving the main container centered in the middle.

Thanks a lot



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum