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

  • Home
  • SEARCH
  • 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 8899191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:48:00+00:00 2026-06-15T00:48:00+00:00

I want to stretch background color (or an image) so it would look like

  • 0

I want to stretch background color (or an image) so it would look like the bottom example in

this jsfiddle

Same code but here:
Example1:

<div class="fixed_width">
  <div class="header">Header</div>
  <div class="menu">
      Here be some menu
  </div>
  <div class="content">
      Here be some content<br/>
      ANd even more
  </div>
</div>

Example 2

<div class="fixed_width">
  <div class="header">Another<br/>Header</div>
  <div class="menu2">
      Here be some menu
  </div>
  <div class="content">
      Here be some content<br/>
      ANd even more
  </div>

CSS:

body {background: lightgray}
.fixed_width {width: 500px; border: solid thin black; 
  margin: 20px auto; background: white;}
.menu {background: blue; color: white; padding: 20px; 
  margin-bottom: 10px;}
.content {background: white; border: solid thin gray; 
  margin: 5px;}

.menu2 {width: 500px; background: blue; color: white; 
  margin-bottom: 10px;padding: 20px 2000px 20px 2000px; 
  margin-left: -2000px;}

Bottom example is something I came up with but the problem is browser wants to scroll to those 2000px on the right.

The structure of the page is similar to the code in jsfiddle and as you can see there is no telling where exactly the top of menu will be – above it there will be a header which can have variable height (so I can not use a nice pre generated whole page background image).

I can not disable scroll because on smaller screens ppl wont be able to scroll. Please help me fix that (if possible).

  • 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-15T00:48:01+00:00Added an answer on June 15, 2026 at 12:48 am

    put your menu in a wrapping element, give the latter a width of 100% (assuming it is the top most element), and center the menu:

    HTML:

      <body>
         <div id="menu_wrapper">
            <ul id="menu">
             <li>Item</li>
             <li>Item</li>
             <li>Item</li>
             <li>Item</li>
            </ul>
          </div>
      </body>
    

    CSS:

      #menu_wrapper {
      width:100%;
      background:blue;
      }
      #menu 
      width:1000px;
      margin:0 auto;
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

look here: http://jsfiddle.net/QTrat/10/ I want to stretch the red box to the floated children
I want to change a button's color on hover. This is my xaml code.
I've got a graph that looks like this: And I want it to look
I think an image best describes this: JS FIDDLE HERE: http://jsfiddle.net/fp2Ak/ What I want
I want to stretch the navigation and content column to the bottom of the
Possible Duplicate: Stretch and Scale a CSS image Background - With CSS only A
How can I define background-image repeat with cap insets? I want the image to
I want to give the users the ability to set the background color or
I have 5 buttons having a 9 patch image set as its background. but
I have wpf Expander control and I want change background color of Header when

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.