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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:24:09+00:00 2026-05-11T11:24:09+00:00

I’ve been a web developer for really quite some time now, but this is

  • 0

I’ve been a web developer for really quite some time now, but this is something I’ve never really done, and my progress so far has used some very complex methods. The following is the layout I want, there are rules to this layout though, as I will explain in a moment.

    ----------------------------------------------------     |                      HEADER                      |     ----------------------------------------------------      ________   _______________________________________     |        | |                                       |     |        | |                                       |     |        | |                                       |     |        | |                                       |     |        | |                                       |     |        | |                                       |     |        | |                                       |     |        | |                                       |     |________| |                                       |                |                                       |                |                                       |                |                                       |                |                                       |                |                                       |                |_______________________________________| 

The sidebar and the header are static and so is the body, however you can scroll the body. Using the CSS property overflow:scroll on a container for the body section is not an option. The reason being is that it’s an ASP.NET application which utilises the maintainpositiononscrollback, meaning that the browser scrollbar – not a contain scrollbar – is what is used to record the x and y position. I have achieved this but using some complex layout techniques which just aren’t pretty.

So my HTML looks like the following:

<div id='header'>   <ul>     <li><a href='/'>Home</a></li>     <li><a href='#'>Telephone</a></li>     <li><a href='#'>My Department</a></li>     <li><a href='#'>My Profile</a></li>   </ul> </div>  <div id='sidebar-container'>   <div id='sidebar'>     <!-- sidebar code using ul's and li's -->   </div> </div>  <div id='content-top-border'></div> <div id='content-left-border'></div>  <div id='content-wrap'>   <div id='content'>     <asp:ContentPlaceHolder ID='MainContent' runat='server' />   </div> </div>  <div id='content-right-border'></div> <div id='content-bottom-border'></div> <div id='bottom-block'></div> 

So I use all of these divs for a specific reason, so I can absolutely position borders on the content area. The rest of the divs actually block off content by changing the background colour of them so you can’t see the content when you scroll.

My CSS file is far too large to be posting on here, but here’s the general idea:

div#header {     height:30px;     background-color:#d7d7d7;     position:fixed;     top:0;     left:0;     right:0; }  div#sidebar {     position:fixed;     top:30px;     left:0;     overflow:auto;     bottom:4px;     width:148px;     background-color:#d7d7d7; }  div#sidebar ul {     border:1px solid #9a9a9a;     border-bottom:0;     font-family:Tahoma;     margin:0 0 0 4px;     padding:0;     list-style-type:none;     font-size:0.75em;     width:137px;     clear:both;     background-color:white; } 

So as you can see from the sidebar, I set a fixed width, make it position:fixed and then set a background. The containing <ul> has a fixed width thus causing a block. When you horizontally scroll the page, the content will be hidden when it hits the sidebar. This creates an effect much like any client-side application.

#content-wrap {     position: absolute;     top: 30px;     bottom: 15px;     left: 147px;     right:0;     background-color:#d7d7d7;     z-index:-998; }  #content {     z-index:-995;     position:absolute;     top:0;     bottom:0;     right:0;     left:0;     padding:10px 10px 20px 10px;     background-color:#FFF;     color:#292929; } 

So you can see that the #content has absolute positioning keeping it in that content box. Anything outside of the content box is never displayed even if you scroll horizontally or vertically.

Are there better ways of doing this? It seems a heck-of-a-lot of HTML/CSS to be doing something really quite simple.

EDIT: This layout isn’t a problem whatsoever. That part isn’t even difficult. What’s difficult is maintaining simple HTML/CSS with a complex layout, and by complex, I don’t mean something I’m unable to achieve. I have achieved the desired effect already, I’m just looking for a better way of doing it.

EDIT: This is based on business requirements, I don’t have a choice 🙂

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T11:24:10+00:00Added an answer on May 11, 2026 at 11:24 am

    Fixed position elements are typically a bit of a warning sign for me- by taking things out of the document flow you are losing one of the main benefits of CSS, which is it’s flexibility. Again, by mixing px and em measurements you are creating a slightly mixed-up stylesheet jam that doesn’t allow for the page to be resized easily.

    However the central problem seems to be a question of whether you are barking up the right tree in terms of approach and outcomes. Do you have to be using the maintainpositiononscrollback option from ASP.NET? It wouldn’t be too hard to implement a bit of light javascript to create an equivalent effect on an overflowed div. If you are stuck with the asp.net code, do you have to have your text in a small box like that or could you just let the page be as long as the content?

    If you have to use the maintainpositionscrollback and you have to have the content in a small box you might be better off using some less standards-friendly code for your markup- perhaps putting the content in an iFrame would give you the behaviour you are looking for. If you’re losing most of the benefits of semantic html and css in order to implement the design you want then you’re not going to sacrifice much more by taking a different approach to the design.

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

Sidebar

Ask A Question

Stats

  • Questions 90k
  • Answers 90k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Q1: Forms authentication uses machineKey to encrypt the cookie. Since… May 11, 2026 at 6:01 pm
  • Editorial Team
    Editorial Team added an answer Even though what is and is not good practice is… May 11, 2026 at 6:01 pm
  • Editorial Team
    Editorial Team added an answer You need to create a page in which you render… May 11, 2026 at 6:01 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.