Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts

    make left and right floated images bleed off screen

    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?

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello surreal5335,
    If you put all three main elements into a centered containing element, you would be able to stop that float drop.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts
    Thanks for the reply,

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

    HTML
    Code:
    <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
    Code:
    .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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •