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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:38:53+00:00 2026-05-22T17:38:53+00:00

Here is my css and html #header { position: absolute; left: 0; right: 0;

  • 0

Here is my css and html

#header {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    background-image: url('/public/images/header.png');
    background-repeat: repeat-x;
}

#nav {
    background: transparent;
    height: 2.5em;
    left: -25px;
    list-style: none;
    margin: 1em 0 1em;
    min-width: 100%;
    min-height: 100%;
    overflow: hidden;
    padding: 60px 0 30px 0;
}

#nav a {
    color: white;
    display: block;
    float: left;
    height: 2.5em;
    padding-left: 30px;
    text-decoration: none;
    padding-right: 30px;
    text-shadow: 0.1em 0.1em #333;
}

#nav a:hover {
    text-shadow: 0.1em 0.1em white;
    background-color: white;
    color: darkred;
    padding-bottom: 5px;
    text-shadow: 0.1em 0.1em lightgray;
}

#nav a:hover.active, #nav a.active {
    background-color: white;
    background-position: 0 -60px;
    color: darkred;
    text-shadow: 0.1em 0.1em lightgray;
    padding-bottom: 5px;
}

#nav li {
    float: left;
    margin: 0 8px 0 0;
 /* Spacing between tabs */;
}

#nav span {
    cursor: pointer;
    display: block;
    float: left;
    line-height: 1.5em;
    padding: .5em 5px 0 0;
}


<div id="header">
    <div id="navigation">
        <ol id="nav">
            <li><a id="overview" href="/overview"><span>Overview</span></a></li>
            <li><a id="analysis" href="/overview" class="active"><span>Analysis</span></a></li>
            <li><a id="dashboard" href="/dashboard"><span>My Dashboard</span></a></li>
            <li><a id="preferences" href="/overview"><span>Preferences</span></a></li>
            <li><a id="contact" href="/overview"><span>Contact</span></a></li>
            <li><a id="logout" href="/overview"><span>Sign In</span></a></li>
        </ol>
    </div>
</div>

This looks fine on my screen but if I start resizing the window it makes the tabs jump around and go to the next line. I’ve found that on other sites with tabs this is not the case. What am I doing wrong here? Thanks.

  • 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-22T17:38:53+00:00Added an answer on May 22, 2026 at 5:38 pm

    These “other sites” probably have their <div id="header"> contained in another element, such as <div id="container">, with an explicit width set with CSS, such as width: 960px:

    See: http://jsfiddle.net/mBJQN/

    <div id="container">
        YOUR HTML HERE
    </div>
    
    #container {
        width: 960px;
        position: relative
    }
    

    I added position: relative so that the position: absolute on #header will be relative to #container (see here).


    There is another option here, but it’s probably not the one you’re after.

    You can add white-space: nowrap to #header, and change from floats to display: inline-block. If this is the option you want, let me know, because it needs a little more work.

    http://jsfiddle.net/mBJQN/1/

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

Sidebar

Related Questions

Total noob question, but here. CSS .product__specfield_8_arrow { /*background-image:url(../../upload/orng_bg_arrow.png); background-repeat:no-repeat;*/ background-color:#fc0; width:50px !important; height:33px
It has to be simple, here's my CSS: .progressImage { position:relative; top:50%; } .progressPanel
As detailed here among other places, the only valid characters in a html/css class
I've got a question about creating a vertical image sprite menu. Here's my HTML:
Hello all,I'm a junior on html,I have a question about css position : first
Here is an example of an HTML page that consists of a header and
I have a design where there is a header set at absolute position with
I need some advanced CSS help here. I have a login button and a
Here is a snippet of CSS that I need explained: #section { width: 860px;
Here is the problem: we have lots of Javascripts and lots of CSS files,

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.