homepage Welcome to WebmasterWorld Guest from 54.196.225.45
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Displaying differently in both IE & FF
Spyce




msg:4351014
 11:19 pm on Aug 12, 2011 (gmt 0)

I'm simply trying to get the wire frame of my website working, then I can toss in all the images and content later.

Problem: What I am aiming for is to have the header in a static position at the top of the site so the only part of the site that scrolls is the content. In Firefox, this works like a gem. However in IE (I have IE 9 currently installed), this doesn't work. The header just scrolls with the rest of the site. I've tried to Google a fix for this, but I've come up empty-handed.

This is all my code (live version::
<html>
<head>
<title></title>

<link rel="stylesheet" type="text/css" href="style.css">

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie.css">
<![endif]-->

</head>

<body>
<center>
<div id="masterHead">
header & nav stuff here.
</div>
<div id="masterBodyCont">
<div id="contentBox">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer rutrum aliquet mattis. Nullam vel accumsan lacus. Praesent in velit magna, dignissim ultrices turpis. In et consectetur mi. Vestibulum nibh ipsum, iaculis ut interdum non, congue sed odio. Aenean quis urna mauris. Fusce vel tristique dui. Mauris elementum volutpat eleifend. Aliquam fermentum, orci vitae euismod semper, augue risus varius est, vel posuere urna orci sit amet nunc. Proin tortor nibh, hendrerit vel scelerisque vitae, tincidunt vitae libero. Cras eget faucibus tellus.

Morbi lobortis lorem non ligula venenatis dictum. Fusce lacinia congue tellus, sed luctus felis molestie sit amet. Vestibulum sit amet mi nec ipsum aliquam rhoncus ut eget urna. Aliquam erat volutpat. Fusce sit amet turpis sem. Donec vehicula elementum mollis. Sed at libero metus. Pellentesque egestas cursus pulvinar. Nulla tincidunt, est non dictum hendrerit, libero nibh rhoncus mauris, at rutrum urna erat sit amet ipsum. Sed non neque mauris, nec gravida lectus. Nunc cursus tempus mi id volutpat. Quisque a quam eget neque luctus venenatis. Etiam vestibulum nunc eu ante hendrerit ultrices. Aliquam erat volutpat. Curabitur et lectus vitae neque placerat tempor vel et arcu. Aenean vitae urna erat, eget laoreet ante. In ultricies nisi non tellus convallis at auctor magna aliquet. Nulla nisi sem, faucibus nec semper et, vulputate non arcu. Fusce at sem vel sapien dignissim facilisis sed eu velit. Sed tempus viverra ante, eget aliquam lorem venenatis non.

>>>> I deleted most of the dummy text for the sake of this post. <<<<<
</div>
</div>
</center>
</body>

</html>


Please, if you have any ideas or suggestions, I'd love to hear them. I've been trying to figure this out for over an hour now and I'm about ready to start pulling my hair out.

[edited by: Spyce at 11:41 pm (utc) on Aug 12, 2011]

[edited by: alt131 at 6:43 am (utc) on Aug 13, 2011]
[edit reason] Thread Tidy [/edit]

 

g1smd




msg:4351015
 11:28 pm on Aug 12, 2011 (gmt 0)

Start here: [validator.w3.org...]

Spyce




msg:4351017
 12:05 am on Aug 13, 2011 (gmt 0)

Umm... thanks but not exactly the kind of advice I'm looking for. No CSS errors were found so that didn't help.

Does anybody else have any other advice/suggestions?

Paul_o_b




msg:4351100
 9:25 am on Aug 13, 2011 (gmt 0)

Hi,

If you don't have a full doctype on your page then all versions of IE party like its 1999 :) and behave much like IE5. That means they don't understand anything new (and as such ie6 and under do not understand position:fixed in any mode) and in quirks mode (no doctype) then no version of IE will understand position:fixed (among many many other things).

Make sure you have a full and valid doctype and the fixed position will work in ie7+.

Use this doctype:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>

<body>
</body>
</html>


Spyce




msg:4351104
 10:49 am on Aug 13, 2011 (gmt 0)

Gotta love internet explorer.. haha. It messes up the layout doing that, but that's ok. It's nothing a little CSS-lovin' can't fix! :-p Thanks for the info!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved