# Html sidebar question

**URL:** <https://boards.straightdope.com/t/html-sidebar-question/632211>\
**Category:** Factual Questions\
**Created:** [August 21, 2012, 8:59pm UTC](https://boards.straightdope.com/t/html-sidebar-question/632211 "2012-08-21T20:59:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrandonKeir](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@BrandonKeir](https://boards.straightdope.com/u/BrandonKeir)\
**Post date:** [August 21, 2012, 8:59pm UTC](https://boards.straightdope.com/t/html-sidebar-question/632211/1 "2012-08-21T20:59:23Z")

</div>

okay SO I’m trying to make THIS CODE so it has a transparent background but as of right now im stuck with trying to make that happen! please help! 🙂

\<!—SideBar—\>

\<!-- IE in quirks mode →   
\<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0//EN”\>  
\<title\>Fixed left-sidebar\</title\>  
\<style type=“text/css”\>  
body{  
margin:0;  
padding:0 0 0 \<length\>;  
}  
div#left-sidebar{  
position:absolute;  
top:0;  
left:150;  
width:\<length\>;  
height:100%;

}  
@media screen{  
body\>div#left-sidebar{  
position:fixed;  
}  
}

- html body{  
overflow:hidden;  
}
- html div#content{  
height:100%;  
overflow:auto;  
}  
\</style\>  
\<div id=“left-sidebar”\> \<center\> \<font color="#FFFFFF"\> SHIT GOES HERE\</font\> \</center\> \</div\>  
\<div id=“content”\> \</div\>

---

<div class="post-metadata">

**Author:** ![Duckster](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/duckster/32/1244_2.png) [@Duckster](https://boards.straightdope.com/u/Duckster)\
**Post date:** [August 21, 2012, 9:21pm UTC](https://boards.straightdope.com/t/html-sidebar-question/632211/2 "2012-08-21T21:21:10Z")

</div>

Your code is a mess. 😃

You’re missing CSS with inline code. Never a good idea. Makes it very difficult to review.

You should float your sidebar to the left rather than an absolute position.

Is this what you really what to do?

[http://css-tricks.com/examples/SuperSimpleTwoColumn/](http://css-tricks.com/examples/SuperSimpleTwoColumn/)

Since you haven’t defined your background, the background defaults to whatever the browser decides to show.

---

<div class="post-metadata">

**Author:** ![Blakeyrat](https://avatars.discourse-cdn.com/v4/letter/b/ecd19e/32.png) [@Blakeyrat](https://boards.straightdope.com/u/Blakeyrat)\
**Post date:** [August 21, 2012, 10:35pm UTC](https://boards.straightdope.com/t/html-sidebar-question/632211/3 "2012-08-21T22:35:47Z")

</div>

You haven’t defined a background (at least, not in the sample you’ve given us) so the background is whatever the browser’s default background is. (Generally: white. But don’t assume it’s white.)

Also I agree: don’t mix up CSS styles and inline styles/tags that were superseded with CSS. It’s probably a bad idea to have both CSS and a \<CENTER\> tag in the same page-- it’s one of those “it’ll probably work but…” kind of situations.

---

<div class="post-metadata">

**Author:** ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)\
**Post date:** [August 22, 2012, 2:44am UTC](https://boards.straightdope.com/t/html-sidebar-question/632211/4 "2012-08-22T02:44:05Z")

</div>

What does “width: \<length\>;” mean?
