Click to See Complete Forum and Search --> : HTML programming : IE vs Mozilla/Netscape


Bowtie
02-24-2004, 07:16 PM
I'm just learning how to do some HTML programming (O'Reilly HTML / XHTML book :D ) and there are some differences on how things are displayed or handled between the 2 browser camps. Something I think is slick is the <bgproperties="fixed">. Makes an easy watermark for a page. IE supports it no problem. Mozilla still scrolls the background image though. Is there a way to "freeze" the background image for Mozilla? Sorry if this is a stupid question. This is the first time I've had the time to sit down and learn how to do any programming. Once I get comfortable with HTML, I've got C++, VB, and Perl books to go through:D This could be addictive;)

bwkaz
02-24-2004, 07:54 PM
You don't use HTML to freeze the background image.

What you do is use CSS:

div.background {
position: fixed;
} Then, in the HTML:

<div class="background">
<img src="whatever" alt="" />
</div> The class="background" tells CSS-aware browsers to use the CSS attributes for the div.background selector for this div (don't know if you know or not, but basically, div's are just blocks on the page used to set off certain page elements).

The problem is, no version of IE supports the "position: fixed;" attribute (likely because it's CSS2... but IE is CSS compliant! :rolleyes: ). You would probably have to use the IE-specific HTML crap for that broken piece of ... well, browser, I suppose, though I don't know if real browsers screw up if they're given those tags.

Also see http://www.w3.org/Style/Examples/007/menus.html and http://devnull.tagsoup.com/fixed/

Bowtie
02-24-2004, 11:28 PM
Cool. Appreciate the info and the leads. I've read bits and pieces so far that have mentioned style sheets. Guess I'll discover that when I get towards the end of the book.:D I can't stand IE but most of my friends use it so I was thinking about just creating pages for it. I'll have to get to the style sheets and see how Mozilla does with them. I didn't think I'd like any kind of programming, but this shiznit is cool:D