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 6162339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:38:12+00:00 2026-05-23T21:38:12+00:00

I am using the following CSS code to stretch an element ( <header> in

  • 0

I am using the following CSS code to stretch an element (<header> in this example) so that it fits the browser window width:

header {
    font-size: small;
    color: white;
    overflow: auto;
    background-color: rgba(51, 51, 51, .8);
    padding: 3px 3px;
    width: 100%;
}

but the problem is that this element, or any to which I apply width: 100%; overflow: auto; overflows the window limits:

| <--- window width ---> |
|  <--- element width ---> |

How can I set the CSS properties so that the element width fits exactly the window width?

| <--- window width ---> |
| <--- element width --> |
  • 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-05-23T21:38:13+00:00Added an answer on May 23, 2026 at 9:38 pm

    Remove your padding. Adding padding adds additional width. So, your statement is like saying “make it 100% wide, but then add 6px.

    If you want it to be fullscreen WITH padding, make it fullscreen, then add a div within it that has the padding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to accomplish the following using CSS: <table border=1 width=300px> <tr> <td rowspan=2>This
Hallo, I using the following code from css play. this display a menu. .preload16
Im using the following JS <a href=# onClick=if($(this).next('div').css('display') == 'none') { $(this).next('div').show('fast'); } else
I have the following code: CSS #main { width:100%; height:120px; border:solid 1px #efefef; }
am using the following css code for the style, but it is not working
I am using following CSS code to align Input Boxes, but still nothing seems
I am using following code in CSS to render fonts, but it is not
I want to change the width of elements rendered using following code. I have
I am using the following CSS code: body { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='//images/homebg.png', sizingMethod='scale'); -ms-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='//images/homebg.png',
I am using the following well-known CSS code to get a drop down menu

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.