Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 17th, 2006, 04:45 PM
jerschmidt14@gmail.com
Guest
 
Posts: n/a
Default CSS

I am trying to get a page with navigation menus working in CSS. The
following HTML works fine in Firefox, but renders very ugly in IE. IE
does not extend the left bar from the top of the screen to the buttom,
Firefox works ok. Any ideas? I got the example from
http://www.w3.org/TR/REC-CSS2/visuren.html, I have added background
coloring to show the problem.

Jeremy

==============
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<TITLE>A frame document with CSS2</TITLE>
<STYLE type="text/css">

BODY {
height: 8.5in;
} /* Required for percentage heights below */
#header {
position: fixed;
width: 100%;
height: 15%;
top: 0;
right: 0;
bottom: auto;
left: 0;
background-color: yellow;
}
#sidebar {
position: fixed;
width: 10em;
height: auto;
top: 15%;
right: auto;
bottom: 100px;
left: 0;
background-color: green;
}
#main {
position: fixed;
width: auto;
height: auto;
top: 15%;
right: 0;
bottom: 100px;
left: 10em;
background-color: red;
}
#footer {
position: fixed;
width: 100%;
height: 100px;
top: auto;
right: 0;
bottom: 0;
left: 0;
background-color: blue;
}
</STYLE>
</HEAD>
<BODY>
<DIV id="header"> works </DIV>
<DIV id="sidebar"> left sidebar </DIV>
<DIV id="main"> main </DIV>
<DIV id="footer">footer </DIV>
</BODY>
</HTML>

  #2  
Old March 18th, 2006, 09:45 PM
Chris Beall
Guest
 
Posts: n/a
Default Re: CSS

jerschmidt14@gmail.com wrote:
[color=blue]
> I am trying to get a page with navigation menus working in CSS. The
> following HTML works fine in Firefox, but renders very ugly in IE. IE
> does not extend the left bar from the top of the screen to the buttom,
> Firefox works ok. Any ideas? I got the example from
> http://www.w3.org/TR/REC-CSS2/visuren.html, I have added background
> coloring to show the problem.
>
> Jeremy[/color]
(snip HTML)

Jeremy,

Your interpretation of the W3C spec appears to be flawless.

Unfortunately, the same cannot be said for all browsers:

Firefox (actually Netscape 8.1 in Firefox mode) seems to get it right.

Opera does OK, but seem to have trouble correctly rendering the height:
auto on the leftside bar if the screen height is changed.

Amaya doesn't display the 'main' section at all. Their support matrix
says that "Fixed position is managed as absolute position." at the
present time (and they haven't answered my query about what that means),
so we can't expect too much.

IE 6 flat does not support position: fixed. I don't know about IE 7.

The moral of this story is that before you become too attached to a
particular CSS function, you need to get some idea of how well supported
it is. You have just done that...

P.S. You've specified a body height of 8.5 inches and state that it is
required in order for you to use percentages. You might try a height of
100% on body instead. Even on Firefox and Opera I see a vertical scroll
bar which the user can move up and down but which has no effect on the
display (since everything is fixed-positioned). Changing the body
height might get rid of that.

P.P.S. I can't help wondering what is going to happen to TEXT within
this layout if the user either makes the text size larger or the window
smaller. I think it will not be good.

Chris Beall




 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles