Link to home
Start Free TrialLog in
Avatar of RFord
RFord

asked on

Stylesheets

I am using LINK tag to my stylesheets. All works great in
IE 4 but not in Navigator 4.

My code is

<LINK REL=STYLESHEET TYPE="text/css" HREF="style/mkt.css">

and my stylesheet is

BODY {font: 12 pt Arial}
H1 {font: 22 pt Times; color: navy; text-align: center; font-weight: bold}
H2 {font: 18 pt Times; color: navy; text-align: center; font-weight: bold}

The spec on Nav 4 says it supports this type of stylesheet.

What am I doing wrong?
 
Rod
Avatar of martinag
martinag

Is it between <HEAD> and </HEAD>?

Martin
You could also try embedding STYLESHEET inside "".

Martin
Avatar of RFord

ASKER

yes it is in the head tag, sorry I shoid have mentioned that.

Also, the quotes around stylesheet didn't fix the problem
I have no idea what could be the problem. Sorry.

Martin
In your HREF, rather than just the directory, you need to use the entire path.  ie. <LINK REL=STYLESHEET TYPE="text/css" HREF="http://yoursite.com/style/mkt.css"></LINK>

Also, remember the end LINK tag.

Does this work?
I don't think there is an answer.  I think Netscape is just screwed up.  I've looked over your problem again and again and don't see anything wrong.
Avatar of RFord

ASKER

If I use the entire path for the href attribute, that means I have to hard code the path and I don't want to do that the developmental machine is diff from the production box.

Besides, relative paths should work, they do for IE.

I tried the complete path "http://server.domain/" but that doesn't work either.


Guess what?  I built an entire page to HTML 4.0 strict specifications.  I then validated it throught the W3C validator.  HTML 4.0 requires the use of the LINK Rel form of css. In Netscape 4.0 all formatting, i.e. positon, background image, etc... was removed.  I was left with a white page with all items left-aligned.  I don't think that NN4.0 supports this form of stylesheet usage.  To fix it I had to put the entire stylesheet in the HEAD of each page.  Sorry to give you bad news.
Here is my LINK tag that works in both browsers.. the only thing that I see missing in yours is the TITLE paramater... ?  Try adding that.

<LINK HREF = "/CRM/BIN/css/default.css" TYPE="text/css" TITLE = "California Roseville Default Style Sheet" REL=STYLESHEET>
What does the TITLE tag do? It isn't displayed anywhere and it can be set to just anything, right?

Martin
TITLE attribute, of course :-)

Martin
I don't use the title tag, I use relative paths and I use an external files. And nevertheless it works in my homepage!

I've heard, that NetScape has problems with too many spaces. So please try to eliminate as many spaces as possible.

BODY {font:12pt Arial}
H1 {font:22pt Times;color:navy;text-align:center;font-weight:bold}
H2 {font:18pt Times;color:navy;text-align:center;font-weight:bold}

That's the way I do it. And - as I said - it works on my homepage...

Regards, Madshi.
Netscape messes up these cool things like the Hover can't work work on netscape.
Avatar of RFord

ASKER

I tried the TITLE attribute but that did not make a difference in the rendering of my page.

I also tried removing the spaces, that also made no difference in the rendering of my page.

I don't want to use the <STYLE> tag if I can avoid it. Any one have any other ideas?

Madshi, where's your home page?

Could you post your source code for both the LINK and the css?


My homepage is "http://beam.to/madshi".

ns4mad.htm:
"
<html>

  <head>
    <title>Madshi - Informations about Madshi...</title>
    <meta name="description" content="Madshi - Informations about Madshi...">
    <meta name="keywords" content="Madshi, informations, person, human">
    <link rel=stylesheet type="text/css" href="style.css">
    <script language="JavaScript">
      if (!document.layers) {
        if (document.all) { window.location.href="ie4mad.htm" }
        else                window.location.href="oldmad.htm"      }
    </script>
    <noscript><meta http-equiv="refresh" content="0; URL=oldmad.htm"></noscript>
    <script language="JavaScript" src="xx4.js" type="text/javascript"></script>
    <script language="JavaScript" src="ns4.js" type="text/javascript"></script>
  </head>

  <body background="bcklight.gif" bgcolor=#F8F8F8>
    <noscript><a href="oldmad.htm"><font face="Verdana,Arial,sans-serif">Please click here...<a/></noscript>
    <script language="JavaScript">if (document.layers) madPage()</script>
  </body>

</html>
"

style.css:
"
body         { margin-left:10px;margin-top:10px;margin-right:10px;margin-bottom:10px;
               background-image:url(bcklight.gif); background-color:#F8F8F8; }

p,h1,h2,h3,h4,ul,ol,li,div,td,th,address,blockquote,nobr,b,i
             { font-family:Verdana,Arial,sans-serif; }

h1           { font-size:18pt; }

h2           { font-size:16pt; }

h3           { font-size:12pt; }

h4           { font-size:10pt; }

p,ul,ol,li,div,td,address,nobr,b,i
             { font-size:10pt; }

th           { font-weight:bold;font-size:13pt; }

#btnBarIn    { text-align:center;padding-top:14px;text-decoration:none;
               font-family:sans-serif;font-size:13pt;font-weight:bold;font-style:normal;color:#444444; }
#btnBarOut   { text-align:center;padding-top:14px;text-decoration:none;
               font-family:sans-serif;font-size:13pt;font-weight:bold;font-style:normal;color:#EEEEEE; }

#listIn      { padding-left:24px;padding-top:3px;text-decoration:none;
               font-family:Verdana,Arial,sans-serif;font-size:10pt;font-style:normal;color:#EEEEEE; }
#listOut     { padding-left:24px;padding-top:3px;text-decoration:none;
               font-family:Verdana,Arial,sans-serif;font-size:10pt;font-style:normal;color:#000000; }

#title       { text-decoration:none;font-family:Verdana,Arial,sans-serif;font-size:10pt;font-weight:bold; }

a:link       { color:#brown;text-decoration:underline; }
a:visited    { color:#red;text-decoration:underline; }
a:active     { color:#black;text-decoration:none; }
"

Regards... Madshi.
Avatar of RFord

ASKER

Thanks for all who helped, but it seems this is a netscape issue, not a issue with my code.

Rod
Are you using layers?
Because the tags your using sometimes have no effect in layers.

Try something like
  #test { font-family:Arial;font-size:10pt }
in your style sheet.

Then
  <p id="test">test text</p>
in your html.

Does that work? If yes, then your style sheet file is propertly loaded...

Regards, Madshi.
I also noticed something like this happening to me...I did trial and error until I found one that worked...

First----I did it on the Anchor tag not the LINK tag...
A { blahblahblah....}
you could try defining classes for .link .alink .vlink
A.link {blahblah}

and second---I only got this to work in netscape when I defined the style sheet inside the anchor tag too!! <a href="blah" style="blah">BLAH</a>
Avatar of RFord

ASKER

Didn't fit my problem
Avatar of RFord

ASKER

I got my stylesheet to work after playing around with some ideas that were sparked by Madshi's comment on 12/16.

The problem was that I was using tables. So I needed a TD entry in my stylesheet.

Thanks Madshi, if you'll post an answer here, I'll give you the points.



ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
whatever....netscape doesnt get affected by spaces.....
Avatar of RFord

ASKER

It wasn't spaces. I simply needed to utilize a TD line in my stylesheet to define the text in a table cell. I never said it had anything to do with spaces. Madshi's test options helped me to find this.

Besides I got my stylesheet to work w/o placing in a <A> tag.