CSS layout problem - I'm stumped!

S

Si

Hi all.

I have a really weird problem that I just cannot fix. I probably cannot
see the wood for the trees ;-)

I have checked the site in Mozilla/Firefox, Opera but not Netscape ( NS
has decided not to load on my system for some reason) and all is fine.

The site is one that I am building for my step daughter and I'm starting
to look like an incompetant coder whilst I am trying to fix this :-(

The address is

http://www.natashajacobs.com

I hesitate to say I have a table version I knocked up in seconds here
http://www.natashajacobs.com/defaultVer2.asp
to show how it should look and I'm resisting her pressures to 'just use
that one then'

A quick look at the site in IE and my problem is very obvious! I hate IE
sometimes! Unless it is my dodgy coding at fault, in which case I
apologise in advance.

Hope someone can help.

Cheers
Si
 
S

Si

Si said:
Hi all.

I have a really weird problem that I just cannot fix. I probably cannot
see the wood for the trees ;-)

I've found it!

I hadn't validated my style sheet, and low and behold, there was a
sneeky " left over from when I took the style out of the html for
placement in the stylesheet.

W3C helps again!

Si
 
N

n|ck

Si said:

Glad you were able to get it working! Can I suggest a slight change in your
code? It might prevent headaches later.

Instead of:

<style type="text/css" media="screen">
@import "/gallery.css";
</style>

<style type="text/css" media="print">
@import "/print.css";
</style>

Try using this:

<link rel="stylesheet" href="/print.css" media="print">
<style type="text/css" media="screen">
@import url("/gallery.css");
</style>

This will do two things:

a)
Prevent your "flash of unstyled content" problem you're having

b)
Your gallery.css file will be hidden from older browsers like Netscape 4.x
(because of the @import url("") statement) but your print stylesheet probably
does not need hiding from these older browsers and so it's safe keep it visible
for all browsers.

You don't have to take this information on board. If I'm wrong on any of this, I
hope people will correct me but these are the principles I've been working with
since I moved to CSS.

HTH,

Nick.
 
S

Si

n|ck said:
Glad you were able to get it working! Can I suggest a slight change in
your code? It might prevent headaches later.

Always open to suggestions
Instead of:

<style type="text/css" media="screen">
@import "/gallery.css";
</style>

<style type="text/css" media="print">
@import "/print.css";
</style>

Try using this:

<link rel="stylesheet" href="/print.css" media="print">
<style type="text/css" media="screen">
@import url("/gallery.css");
</style>

This will do two things:

a)
Prevent your "flash of unstyled content" problem you're having

I hadn't noticed this effect in any of my tests, I have made the change
suggested above, all seems the same.
b)
Your gallery.css file will be hidden from older browsers like Netscape
4.x (because of the @import url("") statement) but your print stylesheet
probably does not need hiding from these older browsers and so it's safe
keep it visible for all browsers.

I see your point, I've updated the styles, infact, initially, they where
both of the link rel type, it was then that sometimes I noticed FF would
load the page with no style and I had to reload to bring the style sheet
in, this may be a bug in my FF possibly.
You don't have to take this information on board. If I'm wrong on any of
this, I hope people will correct me but these are the principles I've
been working with since I moved to CSS.

Many thanks

Si
 
N

n|ck

Si said:
I hadn't noticed this effect in any of my tests, I have made the change
suggested above, all seems the same.

ah okay, I noticed the flash of unstyled content the first time I loaded the
page but I'm not sure if it was IE or Firefox... I think the bug only occurs in IE?
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top