Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

external css 3

Status
Not open for further replies.

defrex

Programmer
Aug 22, 2001
83
CA
ok, i designed the layout of a site i'm working on with all the css in the header of the html doc. i'm using frames, so one of the pages in the middle will be the only one changing. so, to cut down on copy/past work, and to save me 9 hours when i want to change somthing, i desided to make the css external. but as soon as i did this it just tossed some of it, it kept the link colours and font stuff, but didn't let me keep the coloured scroll bar.

<LINK href=&quot;main.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;>

thats the code i used, any ideas?
 
It is most likely an addressing problem - all your pages are most likely in different directories - and perhaps the location of then file is not matching?

Also, any subsequent styles in the document will overwrite any in the external file.
 
Try filling in the absolute path to your stylesheet and see if that changes anything. Also make sure that the LINK tag appears in each of the documents in each of your frames.

Hope this helps
-Rob
 
i can try using the absolute path but altamitly i'll have to change that. and i can't see how it would make a differance, but i'll try. and i've only tryed it in one page so far, because i can't get it to work.
 
Some people include the HTML-comment tags ( <!-- and --> ) in their CSS-files which makes them unreadable for the browser.
I had this problem myself so that might be it...
//Daniel
 
I have a comment tag as the first line of all my css files, and it hasn't caused me any problems. One thing I have noticed it that sometimes having the css file in the same directory, without a path reference, can cause a problem. What I did to fix it was just prefix the file name with a relative path like this:
Code:
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;./mystyles.css&quot;>
Sounds stupid, but it solved the problem!
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Set all these other recommendations aside.

Whenever I hear about a case like yours (moving styles to an external style sheet, but it &quot;don't work&quot;) I make this suggestion:

Have you checked for CSS-newbie error #1?

In other words, have you left your <STYLE> </STYLE> tags around the block of styles defined in your external stylesheet? They ain't supposed to be there.

Don't feel bad, I seem to make this mistake every time I decide to move styles from the page heading to an external file. Then I'm stumped for a bit, and finally the lightbulb turns on.

Once you've checked this out (and only then) feel free to start theorizing about &quot;browser bugs that require full path names&quot; and such. In my own experience my dumb mistakes are a lot more common than actual bugs in the other guy's code.

But then again maybe these other guys are supercoders or something. ;-)

Just give it a look first, that's all I ask.
 
dilettante, that WAS good advice. I've done that before, but I'd forgetten about that problem.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
aww man, thanx.

i'm at school right now, but i'm like 99% sure thats my problem. lol, you don't understand how much frustration this has been causing me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top