Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8735403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:02:57+00:00 2026-06-13T10:02:57+00:00

I’m having some trouble figuring out how to do this. I want to have

  • 0

I’m having some trouble figuring out how to do this. I want to have a wrapper so my site is centered, but one of the header elements needs to stretch all the way to the right edge of the page, but without expanding the width of the page and adding scrollbars.

See here: http://i49.tinypic.com/6rkaxc.jpg (new poster so can’t add image)

The blue outline represents the centered wrapper, and the orange box is the header div that I’m trying to get to fit to the right side of the page. I’ve got it to work using 100% width but it creates a horizontal page scroll since it’s making it the same width as it’s parent. I want it to expand for users that have higher resolutions so it always fits snug to the right side. I hope this makes sense.

my code looks something like…

<body>
<div id="wrapper">
   <div id="header">
   </div>

   <div id="left">
   </div>

   <div id="right">
   </div>
</div>
</body>

CSS:

div#wrapper {
 margin: 0 auto;
 width: 1020px;
 position: relative;
}

div#header {
 height: 150px;
 position: absolute;
 left: 510px;
 width: 100%;
}

div#left {
 width: 510px;
 float: left;
}

div#right {
 width: 100%;
 float: left;
}

I’m pretty new to this stuff so if you notice any errors here or bad practices please point them out! Thanks for the help! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:02:59+00:00Added an answer on June 13, 2026 at 10:02 am

    Since you want your content to be fixed width, a strategy would be to have containers for both left and right contents. This allows you to use width: 100% for the header which will extend to the end without scroll bars. You then make the header relative to the right container. Here is a jsfiddle you can play with.

    Note I made the widths smaller so it would fit in my jsfiddle window.

    HTML:

    <body>
        <div id="wrapper">
           <div id="leftContainer">
               <div id="left">
                   This is left
               </div>
           </div>
           <div id="rightContainer">              
               <div id="header">
                  This is a header
               </div>   
               <div id="right">
                  This is right
               </div>        
           </div>
       </div>
    </body>          ​
    

    CSS:

    div#wrapper {
     text-align: center;
     width: 100%;
     position: relative;
     white-space: nowrap;    
     overflow-x: scroll;  
    }
    
    div#header {
     z-index: 1000;
     height: 150px;
     position: absolute;
     left: 0;
     width: 100%;
     background: green;    
    }
    
    div#leftContainer {
     float: left;
     width: 50%;
     height: 500px;
     display: inline-block; 
    }
    
    div#left {
     float: right;
     width: 260px;
     height: 300px;
     background-color: purple;
    }
    
    div#rightContainer {
     position: relative;
     float: right;
     width: 50%;
     height: 500px;    
     display: inline-block;  
    }
    
    div#right {
     width: 260px;
     height: 300px;
     background-color: yellow;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
This could be a duplicate question, but I have no idea what search terms
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.