What a brilliant forum. Hope you don't mind newbie questions.
I am quite new to external style sheets. I am using Dreamweaver MX 2004 and have created a dynamic web template. All my local files look perfect - in accordance with the style sheet. However, when I upload my pages, the style sheet doesn't appear to be linked. Below is the code on my template. I have checked that none of my pages have become detached from the template.
<link type="text/css" media="all" rel="stylesheet" href="/styles/style.css" />
Is there something wrong with this link. If I remove the first '/' I lose all the style. I have also tried '../', and that doesn't work either.
Can anyone shed any light on this. Browser is IE6.
Linking external style sheets
Hi Jean,
Can you post a link to the site, it would help a lot.
You could try giving the full address of the stylesheet.
Linking external style sheets
Tony Hi
Thank you for your response.
The site is http://www.petmag.co.uk. You will see how bad it is. The correct style should be a fixed 800 wide, black nav bar with white lettering, black left and right bars. Even the logo is wrong.
I have not re-uploaded the whole site, but you will see what I mean from the index page. It's just so embarrassing as it is at the moment. All my local files are perfect.
Linking external style sheets
Try removing the forward slash from the front of the link!
i.e.
From:
<link type="text/css" media="all" rel="stylesheet" href="/styles/style.css" />
To:
<link type="text/css" media="all" rel="stylesheet" href="styles/style.css" />
Hope that works,
Guy
Linking external style sheets
Guy
Nope that doesn't work either. In fact that takes the style off the local files. Think I'm going a bit grey over this one.
Linking external style sheets
How about:
<link type="text/css" media="all" rel="stylesheet" href="./styles/style.css" />
maybe :?:
Linking external style sheets
Triumph
Thank you, but that doesn't work either.
Linking external style sheets
Jean
When you say your local files are perfect, do you mean in Dreamweaver preview or in an actual browser? The DW (or any wysiwyg, for that matter) preview cannot be trusted and you should always check your design as you go along in an actual browser. The consensus on this forum is to design for and check in Firefox, then check in Internet Explorer for any IE specific code that may be needed.
I don't think it's your stylesheet link that's the real problem, because the stylesheet is actually in the place to which you link.
You have a Javascript error (see attachment) and the page does not validate. See http://validator.w3.org/check?uri=http%3A%2F%2Fwww.petmag.co.uk%2F. Leaving aside the non-XHTML 1.0 Strict code courtesy of Google ads, there are quite a number of other coding problems that could be affecting how the page is displayed. Until it does validate, the css cannot be validated, see http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.petmag.co.uk%2F
You might like to go to the Forum Index and look in the How To section for why html and css validation is important.
I have to say, I don't think DW is doing you any favours here and if you want to go down the html/css road, then hand-coding would be the best way forward.
Linking external style sheets
<link rel="stylesheet" type="text/css" href="styles/style.css" />
and I would get rid of this:
<style type="text/css">
</style>
right before the </head>
and this:
<style type="text/css">
<!--
.style7 {font-weight: bold}
-->
</style>
Linking external style sheets
The path seems ok, and Firefox is showing the page just fine. IE, however appears not to know about the stylesheet. If this jibes with your results, then the path is not the problem.
I do have to wonder what this is all about;
Not Found The requested URL /accessibility/js/' + dirLevel + '../styles/style_gb_large' + styleSuffix +'.css was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.There are 23 of these little puppies.
Lose the browser sniffer. They're not needed, and they don't really work anyway.
Correct your DTD. It should be
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">When incomplete, browsers go into quirks mode. In IE's case, Bad Things Can Happen™.
cheers,
gary
Linking external style sheets
Firefox is showing the page just fine.
I'm intrigued Gary - is your version showing
The correct style should be a fixed 800 wide, black nav bar with white lettering, black left and right bars.
see Jean's post 7 Apr 2:18pm
'cos if it is, I've got some problems with Fx1.0 (can't be bothered to upgrade - again).
Linking external style sheets
Quote:Firefox is showing the page just fine.
I'm intrigued Gary - is your version showing
Quote:The correct style should be a fixed 800 wide, black nav bar with white lettering, black left and right bars.
I've got a burnt orange background on the navbar and sidebars. If I edit #headnav1 {background: del(#e9a241) ins(#000);} it goes black.
see Jean's post 7 Apr 2:18pm
'cos if it is, I've got some problems with Fx1.0 (can't be bothered to upgrade - again).


I have the feeling the problem is related to the 23 404s. Are scripts calling them? I won't bother to 1) search through scripts, or 2) dig through table markup. Somewhere these files are being requested and I think the browser renders what it has and when the stylesheet(

I think, Jean, you are going to have to find those links and shut them down.
cheers,
gary
Linking external style sheets
Gosh
Thanks all. I have printed off all your suggestions and will make some alterations tonight. Unfortunately I have a full time job so can only work on my site in the evenings.
By the way:
I've got a burnt orange background on the navbar and sidebars. If I edit #headnav1 {background: del(#e9a241) ins(#000);} it goes black.
Sorry about that, I changed it last night having designed a new logo. It is now meant to be orange. I thought the black looked a bit harsh.
Lorraine
I did mean they look perfect in Dreamweaver and not the browser. I will check out the validation tonight.
Your comment about hand-coding - if only I could - only been doing this for a few months. Would not be able to hand code yet. I'm not at all knowledgeable about CSS either. The file was given to me so that I could just amend my colors etc as needed. I am learning quite quickly though.
Thank you all again for your help. I will let you know how I get on.
Linking external style sheets
Don't quote me on this, but I believe I read about an IE bug (GASP!) when you set a "media" type for the style sheet. Try this:
<link rel="stylesheet" type="text/css" href="/styles/style.css" />
Hope this helps,
Tim
Linking external style sheets
Well I have tried everything now. Still it doesn't work. Clutching at straws, but could I have a bug in my Dreamweaver programme?
Linking external style sheets
Well I have tried everything now. Still it doesn't work. Clutching at straws, but could I have a bug in my Dreamweaver programme?
I just did recheck your page. Several octothorpes are missing from background colors, eg. EABF40 instead of #EABF40.
cheers,
gary
Linking external style sheets
Your not the only one Gary, I've seen them as well
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>404 Not Found</TITLE> </HEAD><BODY> <H1>Not Found</H1> The requested URL /accessibility/js/' + dirLevel + '../styles/style_large' + styleSuffix +'.css was not found on this server.<P> <P>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. </BODY></HTML>
and am at a loss to explain them. Time to strip out all extraneous code, back to basics it's not, I think, a DW problem.
What's the little bit of javascript code that looks like a styleswitching function? 'setPageStyle()'
Hm, just noticed that you have two instances of the meta character tag you may want to correct that and also use a full url DTD for standards mode.
Hugo.
Linking external style sheets
Hugo: You're right about the js. Look at this pile of [mode="self-censor"]*beep*[/mode]. That bit of script writes 23 links to stylesheets.
Jean: You really do need to follow some of the suggestions.
- Use a complete and proper DTD as both Hugo and I mentioned.
I think someone suggested you validate your html and css. If not, you should. There are errors.
I said earlier that you should rid yourself of the browser sniffing script.
I said you needed to find the source of the spurious css requests. They're still there. Hugo suggested that 'setStyles.js' might be the problem, and I verified. Lose that script.

cheers,
gary
[1]Mine, otoh, are crystal

Linking external style sheets
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
I'm sorry, HTML2.0? What version of DW are you using?
Linking external style sheets
While Hugo is a certified guru, his explanations sometimes lack clarity :wink:[1]
[1]Mine, otoh, are crystal


and never a truer word said in jest !
Reading through the thread it became somewhat clear that the problem was undoubtedly pin downable to something i.e it wasn't just the fairies at work and fairly clear after a while what it almost certainly was. At the end of day it would have taken little time to solve really :roll:
Wow what a bit of script

Jean I would take on board what Gary has said and thank him for making clear what I hinted at in confirming for you the root cause of the problem it's what makes him one of the more dedicated members of the forum and rightly a hidden treasure (sorry just had to get that in one more time Gary

Hugo.
Linking external style sheets
Oops!! Didn't mean to cause a storm. What I have done so far.
Tried various DTD headings.
Printed off the validation report and went through the 72 errors. Did not change all as some referred to the styling and were (I have to assume correct).
The 23 links were probably to the accessibility page which I have since taken out for now.
The whole site had not been uploaded at the time of posting - only the index page, so the errors/bad links on other pages were because of this.
Sorry, haven't yet removed the sniffer.js - will do this tonight.
I am amazed at the problems as this template and css file was created by a 'professional' charging a lot of money (glad it wasn't me paying).
One thought - It was originally created for a php driven site - could that be the problem as mine is just a 'simple' html site.
Another thing I was going to try tonight - if you think it worth it- was to move the css onto the template. I would rather not do this as it defeats the object of trying to keep the html clean.
Thank you all for your support on this - it really is appreciated.
look I'm a flipping Guru, my explanations are not meant to be clear just rather obtuse, deep, sage like, I'm meant to ramble in an esoteric fashion. it's for the student to fathom the meaning in my words
Bless! If only my aged brain could. I always thought I was clever on a computer till I started web building.
I will do a bit more work tonight - perhaps change the 'strict' to 'transitional'.
Could someone take another look now all the files have been uploaded. Hopefully there will be a few less errors.
Many many thanks.
Linking external style sheets
perhaps change the 'strict' to 'transitional'.
Don't. Leave it as strict and fix your coding errorrs.
Linking external style sheets
Jean,
- For any new page, use a strict DTD. Be sure you use the complete version, including the url, eg.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
antibland: That's my story, and I'm sticking to it.
- Remove these lines from your doc;
<script type="text/javascript" src="/js/randomad_home.js"></script> <script type="text/javascript" src="/js/sniffer.js"></script> <script type="text/javascript" src="/js/cookies.js"></script> <script type="text/javascript" src="/js/setStyles.js"></script> <script type="text/javascript"> <!-- setPageStyle() //--> </script>
If you really must have them, add them back after everything's working correctly.
- You still have not corrected the lack of octothorpes on the numeric color values. That's a requirement. Where you have {background-color: 123456;}, it should be {background-color: #123456;}.
- Correct the validation errors. Invalid code can cause unexpected behavior.
- Once the xhtml is correct, validate the css.
cheers,
gary[/]
Linking external style sheets
The validation errors are easy to fix. There are simple things like adding alt tags in images, making sure your tags match, and this:
Line 62, column 48: cannot generate system identifier for general entity "linkid"
...ttp://www.awin1.com/show.php?mid=771&linkid=22817&aid=38051" border="0" alt="
This is because your links use &, instead of the ASCII equivalent, which is &
Linking external style sheets
Line 62, column 48: cannot generate system identifier for general entity "linkid"
...ttp://www.awin1.com/show.php?mid=771&linkid=22817&aid=38051" border="0" alt="
I didn't understand this - I haven't changed that. I had taken out the AW comments at start and end of ad and thought that had affected it, so I put them back in.
My wonderful husband of 36 yrs today is re-uploading the whole site. I will see if he can make the change first.
I confess I have changed the DTD to transitional out of desperation. A friend told me he could see my index page in IE, but I still can't. I've worn out the Ctrl F5.
I will change the DTD back to strict as soon as I have understood all the validation errors.
Of the 34 errors showing on the validation report, there are quite a few saying I can't use "target="_blank". What is this all about. How do I get my pages to open up in a new window using css?
The randomad.js are my banners next to the logo. I have three rotating. The alts I can fix no problem. The aligns I can fix.
It's taking some time, but thanks to your help everyone, I am sure I will get there in the end. If I haven't made a correction, it is because I have just missed it, or have not understood it. I will re-validate this evening and just keep making the corrections. If I get stuck I will come back for help.
For a newbie, this has been the most positive experience I have had since starting this venture. You guys/gals are the biz.
Linking external style sheets
Of the 34 errors showing on the validation report, there are quite a few saying I can't use "target="_blank". What is this all about. How do I get my pages to open up in a new window using css?
The 'proper way' to do things is to use javascript in a manner that fails gracefully.
<a href="some.html" onclick="return !window.open(this.href);">That is an elegant piece of code that fails gracefully. If the js is disabled/missing, it acts as a normal link. Should the js somehow fail to open the new window, it returns 'true' (!false), so the link activates. Should the new window open properly, the js returns 'false' (!true) and the link is not triggered.
cheers,
gary
Linking external style sheets
IIRC (only found out what that means yesterday!), Xhtml 1 transitional allows you to use target blank.
I didn't understand this - I haven't changed that. I had taken out the AW comments at start and end of ad and thought that had affected it, so I put them back in.
I know. When you link to search results and stuff, the address often contains the ampersand symbol. To validate, you need to change it to this:
&
The link will still work fine though.
The randomad.js are my banners next to the logo. I have three rotating.
If you have a php-enabled server, use that instead. I don't know why, I just prefer php over JS.
For a newbie, this has been the most positive experience I have had since starting this venture. You guys/gals are the biz.
Yes, we rule.
Problem solved
We have lift off. Site now working. Still needs a tweak here and there, but at least it's the right shape and the right colours. Many many thanks to all who helped.
I shall now strive for perfection using the 'strict' and validation tool. That is so the best piece of kit.
Thanks again.
Linking external style sheets
I can't believe after all that, the site still doesn't validate. Kind of ruffles the feathers a bit.
Antibland
Linking external style sheets
I'm a newbie at this stuff, so maybe I'm not looking at things right, but when I view the source of that page in my editor, I see an extra DTD URI in the DTD tag, and doesn't the URI for HTML4.01 link to 4.01, rather than just 4? and NO beginning <html> tag - this doesn't cause problems with validation and quirks mode?? I tried validation and got a bunch of META errors that I'd expect were caused by the lack of the <html> tag
I've also noticed on the pages of a friend who uses dreamweaver that the template use results in extra, duplicate, things, such as the 2 charset and author meta's on that page, and 'encourages' forgetting possible crucial things by letting you believe the template provides anything you don't think of!!
I'm learning a lot here just following the excellent detective work of you "gurus", especially the "rather obtuse, deep, sage like" ones, as they make me think!!
Bill