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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:58:26+00:00 2026-05-28T18:58:26+00:00

Okay so I have a problem with a website I am working on.. infact

  • 0

Okay so I have a problem with a website I am working on.. infact I have this problem alot and never asked for help, I think it’s time now. Here is my CSS:


    header {
    background: #EEEEEE;
    height: 50px;
    }
    .logo {
    background: url(logo.png);
    width: 200px;
    height: 40px;
    margin: 0 280px;
    }

When I resize my window the logo in the Header will go in to the right when the window is resized. I have tried position absolute, relative etc but it does the same thing. Any ideas please guys?

Here is my HTML:

<header>

<div class="logo"></div>

</header>

Here are links to pictures representing the problem:

This is where everything is working perfectly everything is alligned:

FullSizedWindow http://dl.dropbox.com/u/6212750/Full%20Sized%20Window.png

and

This is where everything starts to go all over the place:

WhenWindowIsRised http://dl.dropbox.com/u/6212750/When%20window%20is%20resized.png

Any ideas? Please

  • 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-28T18:58:27+00:00Added an answer on May 28, 2026 at 6:58 pm

    Set a width on the header element. It’s defaulting to width: auto; which is spanning 100% of the browser window. Thus, when you re-size the window’s width, the header element is re-sized too moving the contents.

    Update 1

    You’re using a margin to position the logo 280px from the left side of the browser window, so when you resize the window’s width, your logo is moving too- the logo is being ‘pushed’. What you want to do is wrap everything in a container div and set your margin spacing relative to that, not the browser window.

    HTML

    <div id="container">
        <header>
    
        <div class="logo"></div>
    
        </header>
    </div>
    

    CSS

    #container {
        width: 400px;
        margin: 0 auto;
    }
    header {     
        background: #EEEEEE;    
    } 
    .logo {     
        background: url(http://i.imgur.com/4hs7p.png) no-repeat top left;    
        width: 200px;     
        height: 198px;     
        margin: 0;    
    }
    

    fiddle: http://jsfiddle.net/alpacalips/ybe9d/2/

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

Sidebar

Related Questions

Okay, so here's my problem: I have a list of members on a website,
I have a problem with (for me to complicated) MySql query. Okay, here is
Okay, here's my problem: I'm using WatiN to navigate a website, but then a
Okay, so I have this problem with my Fact Table. I need it to
I have one problem with semaphores, I though you could help me.. Okay first
Okay i have this problem with every page i make. im not sure what
Okay guys I have a database I have been working on for days now.
Okay so i have a semi weridish problem with re.sub. Take the following code:
Okay, I have ran in to a problem with VB.NET. So all those defenders
Okay, so I have another question on a prolog homework problem I am struggling

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.