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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:46:50+00:00 2026-05-19T06:46:50+00:00

I find it awkward to create layouts like this that have good semantics. The

  • 0

I find it awkward to create layouts like this that have good semantics.

The left side is a column about 150 pixels wide which contains navigation elements.

I would like to put the HTML for this section of the site at the beginning of the HTML code,
and then have an easy way to force the rest of the page not to encroach on that territory on the left (the 150 pixel column).

I have thought about some options.

  1. Place rest of site content inside a div which explicitly has a left-margin of 150px.
  2. Set the nav element to width 150px and float left. The rest of the page naturally wraps.

Are there other options that are more suitable for this task?

Here are the cons.

  1. Changing the nav element to 200px now requires me to edit the left-margin of the other div to 200px. Sure, this isn’t too bad for a one-time layout change, but what if I had the nav element’s width dynamically change from script? I would need the script to also change the margin of the div.
  2. If the nav element is set to position:fixed (and made to occupy the entire left column of the page) the rest of the page’s wrapping does not accomodate its now stationary behavior and it looks terrible when the page is scrolled. To fix this I need to make the nav element infinite height. I am not sure how to do this the right way. height:9999999px;? That makes my page 10 million pixels high and the scrollbar is now useless.
  • 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-19T06:46:52+00:00Added an answer on May 19, 2026 at 6:46 am

    Create sidebar:

    <!-- html -->
    <nav role="main">
      <a href="link.com">link</a>
    </nav>
    
    //css
    nav{    
      width: 150px;
      float: left;
      display: inline;
      margin: 0;
      padding: 0;
      margin-right: 10px;
    }
    

    Then create a container for your main content

    <!-- html -->
    <section id="main">
      main content in here
    </section>
    
    //css
    section#main{
      width: 500;
      float: left;
      margin: 0;
      padding: 0;
      display: inline;     
    }
    

    As long as you place nav before section in your source code, anything that is in the section will stay away from the left hand column and will not wrap under it.

    Just need to make sure you reset all your css, especially paddings, margins and borders unless you know what you’re doing

    good luck

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

Sidebar

Related Questions

So this may sound a bit awkward, but I would like to have the
I have an awkward situation in which I have a 32-bit lib that must
find whether there is a loop in a linked list. Do you have other
I find that getting Unicode support in my cross-platform apps a real pain in
I find from reading perldoc perlvar, about a thousand lines in is help for
I find that the .NET event model is such that I'll often be raising
Often when I'm using Python I'll find myself writing list comprehensions that look something
I have a table schema similar to the following (simplified): CREATE TABLE Transactions (
So, I currently have a Board class that is composed of Piece s. Each
When writing comments, I sometimes find myself needing to talk about a type (class,

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.