473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Vertical spacing with Fixed top-banner

My problem is that to fix the top banner (div), I get some strange side effects with the letf_div and the c_div (central area) - the vertical scroll bar dosen't respect the size ove the window (grows past it). With the browser maximized I manage to get a nice look using:

height:83%;

The problem is that as soon as the browser is resized it all falls apart! Any clues on how to make this work properly?

here's my page:

[HTML]
<html>
<style type="text/css">
* { margin:0; padding:0; font-family:Tahoma,Geneva,Arial,Helvetica,sans-serif; font-size:12px; text-decoration:none; }
a { color: #000000; text-decoration: none; }
a:hover { color: #f98f01; }

#main { overflow:hidden; }
#div_top { position:fixed; width:100%; height:104px; background-color:#ddc4c2; }
/* top div contents */
#top_menu { position:absolute; left:1.7em; top:33px; }
#logo { position:absolute; float:right; top:30px; right:30px; }
#section_name { position:absolute; font-size:3em; color:white; top:52px; left:0.8em; }
/* end of top div contents */

#container { position:absolute; top:104px; width:100%; height:100%; overflow:hidden; }
#left_div { visibility:hidden; position:relative; float:left; width:20%; height:83%; background-color:#ffcc44; overflow:hidden; }
#c_div { position:relative; float:left; width:80%; top:104px; height:83%; overflow:auto; }

</style>

<body id="main">

<div id="div_top">

<div id="top_menu">{{for menu in [('Index', 'index'),
('About the company', 'about'), ('Sports','sporting'),\
('News', 'novelties'), ('Pictures', 'pictures'), ('Contact', 'contact')]:}}
{{=A(menu[0], _href=menu[1])}}
{{if menu[0] != 'Contact':}} |
{{pass}}
{{pass}}
</div>

<div id="logo"><img src="/{{=request.application}}/static/companylogo.gif" alt="The company"></div>
<div id="sectionname">{{=sectionName}}</div>

</div>

<div id="container">

<div id="left_div">left area menu<br/>

</div>

<div id="c_div">central area - contents<br/>
blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>
blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>
blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>
blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>
blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>
blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>
blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>
blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>blabla<br/>
</div>

</div>
</body>
</html>
[/HTML]
txs for all the help,
The web Malik
Jan 22 '08 #1
1 1422
harshmaul
490 Expert 256MB
Firstly visit w3c and get your mark to validate.

Then....

you always gonna get this problem if you mix heights as a percentage, and hieghts as pixels.

i would say use percentages and make sure they add up to 100.
Jan 25 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Dave | last post by:
Hi, what Property and Values are used to space out further from one another the items in a list (assuming it's possible)? The default presentation is a bit "bunched up" for me. Thanks, Dave
1
by: Marek Mänd | last post by:
<style> ..menu{ background:yellow; font:12px Arial; } ..menu li{ margin-bottom:0; margin-top:0; padding-bottom:0; padding-top:0;
2
by: fuzzyman | last post by:
In a couple of places on my webpages I have several items that I would like to be arranged vertically. URLS : http://www.voidspace.org.uk/python/index.shtml ,...
16
by: Uncle Pirate | last post by:
This has me stumped. I am trying to use as little space as possible at the top of my document but Firefox/Mozilla insists on placing vertical space before any element. IE displays it correctly...
0
by: Old Wolf | last post by:
I have a site that I laid out with tables, and lots of grotty hacks and lots of markup generated by client-side javascript. I'm in the process of converting it to "nice" CSS code but have got...
5
by: Goldy | last post by:
Hello, w/ code like this: <table border="0" cellspacing="0" cellpadding="0"> <asp:Repeater runat="server" id="op"> <HeaderTemplate></HeaderTemplate> <ItemTemplate> <tr> <td...
2
by: larzeb2000 | last post by:
I made a vertical navbar using a background image for the buttons. When I tested under FF or Opera, it looks fine, with the buttons touching vertically. However, in IE6 the buttons are spaced apart...
5
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
1
by: dave8421 | last post by:
Hi, I have a (strict) html document with the following portion: <ul> <li><img alt="" src="images/image1.jpg" /></li> <li><img alt="" src="images/image2.jpg" /></li> <li><img alt=""...
1
by: mactelesis | last post by:
I have searched for "vertical stretch, align, etc." and have tried (and failed) with all of the solutions to stretch the "#nav vertical" div so that it streches to the height of the page. As you can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.