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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:06:28+00:00 2026-05-25T19:06:28+00:00

So basically, my css and html works like this. I have a top and

  • 0

So basically, my css and html works like this. I have a top and bottom to the header, as well as a userbox if the user is logged in. My html and css are formed like this:

<div id=header>
 <div id=leftheader>
  <div id=topheader>
    [top header]
  </div>
 <div id=bottomheader>
   [bottom header] 
 </div>
</div>
<div id=rightheader>
   [userbox]
</div>

In a sense, I want the userbox to appear to the right of the top and bottom nav menus when the user is logged in. However, if they’re not logged in, I want to make the headers expand the full width of the screen. I have the PHP which does the back end.

The previous was accomplished easy by doing width: 100px; on the top and bottom divs. However, when I log in, the userbox appears below the two nav menus. One way I thought to get around this is to make the widths not always 100%. Is there any way to do this to still have my userbox on the right?

I tried using max-width, and I take it that it is not defined.

For reference I have the top and bottom headers floated left and the right header floated right. 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-25T19:06:29+00:00Added an answer on May 25, 2026 at 7:06 pm

    This is possible with a <table> layout pretty easily. But since your question involves <div> elements and I presume you want a CSS solution, the following should work:

    <style type="text/css">
    #header { display: table; width: 100%; }
    #leftheader, #rightheader { display: table-cell; }
    </style>
    
    <div id="header">
        <div id="leftheader">
            <div id="topheader">[top header]</div>
            <div id="bottomheader">[bottom header]</div>
        </div>
        <div id="rightheader">
            [userbox]
        </div>
    </div>
    

    jsFiddle: http://jsfiddle.net/fausak/ju3su/

    Here’s a link to quirksmode.org talking about display: table: http://www.quirksmode.org/css/display.html#table

    display: table tells the element to display as a table. Nested elements should be displayed as table-row and table-cell, mimicking the good old TR’s and TD’s.

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

Sidebar

Related Questions

Is it possible to have a CSS rule which basically undoes a prior rule?
Basically I have a div at the very top of my site that I
I am have buttons like this: <button type=button class=img img_button_bla onclick=...>Bla!</button> The img class
basicaly I have the following HTML/CSS Layout HTML: <div id=container> <div id=main> <h1>TEST</h1> </div>
This is for the usual PHP/SQL/html/CSS type of webdev. Site might be visited by
Does anybody know a way with JavaScript or CSS to basically grey out a
Basically what I want to do it this: a pdb file contains a location
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I have some code to check a specific directory to see if an
Basically, I would like a brief explanation of how I can access a SQL

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.