p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 (http://p2p.wrox.com/forumdisplay.php?f=154)
-   -   <style> tags in a <body> vs. <div> (http://p2p.wrox.com/showthread.php?t=27340)

bcat March 27th, 2005 03:25 AM

<style> tags in a <body> vs. <div>
I have been creating a website, solely using CSS and HTML. This particular site revolves aroung a 225px. image on the left side of the screen with all of the content to the right of that picture.

The problem that I am having is that when I put <style> tags into a <div>, it works in Netscape, Opera, and Safari; but not IExplorer. I was given the advice to remove this tag and put it in the <body> tag. When I did this, nothing recongized the 225px image, not even Netscape.

This is a very importand quiestion that my ENTIRE site revolves around and works with all browsers except the widely-used Internet Explorer. Cen you please help me with this problem?

The exact advice given to me was remove:
div.top {
     position: absolute;
     top: 0;
     bottom: 0;
     left: 0;
     right: 0;
     backgroung-image: url('nav.jpg');
     background-repeat: repeat-y;

and replace that with:

body {
     background-image: url('nav.jpg');
     background-repeat: repeat-y;

The problem with the <body> tag is that NO BROWSER recognizes it.

richard.york March 27th, 2005 08:50 AM

Hi, I already answered your question the other day.

You cannot have <style> tags in external style sheets! There can be no markup in external style sheets, only CSS rules. That's why you couldn't get any browser to see the background image on the <body> element, they are suffering from errors from the presence of bad syntax, namely markup where there isn't supposed to be any. I don't know how I can explain it more clearly.


Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design

All times are GMT -4. The time now is 03:58 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.