CSS Positioning Cross Browser Help Needed!

R

rob@codebox

Hi,
I really hope someone can help me with this - I have a screen layout
that I need to get working, it's oh so easy in Firefox but just falls
to pieces in IE. 3 boxes: a fixed size menu-style one on the left, a
fixed height, variable width one on the bottom, and a large dynamic box
filling the rest of the screen. Here's a bare-bones version of the
HTML:

<html>
<head>
<style>
div{
border: 1px solid;
position: absolute;
}
#leftBar{
left: 2px;
top: 2px;
width: 100px;
height: 300px;
}
#mainArea{
left: 106px;
top: 2px;
right: 2px;
bottom: 56px;
}
#bottomBar{
bottom: 2px;
height: 50px;
left: 106px;
right: 2px;
}
</style>
</head>
<body>
<div id="leftBar"></div>
<div id="mainArea"></div>
<div id="bottomBar"></div>
</body>
</html>

can any CSS gurus help me with this? :)

many thanks

Rob D
 
D

dorayme

"rob@codebox said:
Hi,
I really hope someone can help me with this - I have a screen layout
that I need to get working, it's oh so easy in Firefox but just falls
to pieces in IE. 3 boxes: a fixed size menu-style one on the left, a
fixed height, variable width one on the bottom, and a large dynamic box
filling the rest of the screen. Here's a bare-bones version of the
HTML:

In case you are not aware of this, IE6 expands boxes to fit the
content unlike the more compliant browsers. At least put in some
content in IE to see the boxes. This design is rather brittle as
a template, the left very narrow for content and will look worse
in non-IE <7 (at least) browsers where stuff ("correctly")
overflows the boxes. I would not recommend this absolute
positioning schema.

Try putting in % margins (leftBar can stay as 2px for Left I
guess) and widths for your boxes for perhaps behaviour that might
suit you better if you insist on the schema. At least for IE (via
star hack or conditional)

#leftBar{
left: 2px;
top: 2px;
width: 10%;
height: 300px;
}
#mainArea{
left: 11%;
top: 2px;
right: 2px;
bottom: 56px;
width: 89%;
}
#bottomBar{
bottom: 12px;
height: 50px;
left: 11%;
right: 12px;
width: 89%;
}
 
R

rob@codebox

thanks for your reply, i'll play around with the percentages approach
for IE then - i was hoping there would be a way to get IE to accept
positioning using the left, right, top, bottom approach but obviously
it won't. i'm not an HTML specialist, and absolute positioning just
seems (to me at least) to be the most logical way of getting
pixel-perfect positioning, you don't sound so keen on it though!
regards
rob d
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Positioning CSS components 1
Please Help? 0
Stuck with html and css 25
Trouble with css 4
Help with Visual Lightbox: Scripts 2
Help needed with code 5
Interfering CSS 1
Help with my responsive home page 2

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top