Newbie question: site not applying CSS stylesheet


#1

The files are all there, and they work when I look at them on my computer in both Firefox and IE. They’re uploaded in the proper directories. Yet, for some reason, the CSS sheet isn’t applying to the .html pages.

http://www.morningstarhall.com

I’m a total newbie to web design, and am lucky to have gotten the site this far. I don’t even know what questions to ask!

Any help would be most appreciated.


#2

I had a quick look at your page and it appears that your css file is named Morningstar.css (note the capital ‘M’), while your page is looking for morningstar.css

Try renaming the CSS file, or changing the reference on your page and it should work OK.

Edit: It is worth remembering for the future that Linux systems, such as those used by DreamHost, use case sensitive filenames. So ‘somefile.jpg’ is considered a different file to ‘Somefile.jpg’. This can be a trap if you are developing the site on a Windows system.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#3

Grrh. Fixed that (stupid mistake), but it still won’t apply the sheet.

Hmm.


#4

So I see. :slight_smile:

Try adding http:// to the line in your source that refers to your CSS;

[color=#0000CC][/color]

or refer to the CSS file relatively using something like;

If the CSS is in the same directory;

[color=#0000CC]href=“morningstar.css”[/color]

If the CSS is one directory level up;

[color=#0000CC]href="…/morningstar.css"[/color]

and so on.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#5

Oh, FFS.

THANK YOU. DUH.

God. I SAID I was a newbie. Didn’t I say?!

Jeez. A thousand humble thanks.

See, now it looks really cool!

I just have to fix every other page.


#6

hehe, we are all newbies at some (most?) things. :slight_smile:

Getting things right can be a pain when you are starting out, nothing seems to go right, but stick with it and over time everything will start to ‘gel’ and then it will all become easier.

It does, most impressive, especially for a ‘newbie’ :wink:

I hope there aren’t too many.

Good luck.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#7

A good way to manage your web pages is to put the codes in an external file. for example, header.php and include the file in every page.

So if you need to do any changes, you do not need to change every page but just do it in the external file.

Save [color=#CC0000]$97[/color] (max discount) on dreamhost plans by using promo code: [color=#CC0000]97CRAZY[/color].


#8

Which is basically what is happening with the external CSS file.

Unfortunately, the original poster got the path wrong to the external CSS file, which is why they have to change each file that references the CSS file. This would be the same if the files had an incorrect path to an external include file.

In situations like this, I thank god for DreamWeavers ‘template’ system. :wink:

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#9

:slight_smile:

what I mean is something like this. if this is the web page,

<?php require_once("header.php"); ?>

in the header.php file:

since every page include the same file, if he needs to make changes again, just modify the header.php file. he does not need to make changes in every page.

Save [color=#CC0000]$97[/color] (max discount) on dreamhost plans by using promo code: [color=#CC0000]97CRAZY[/color].


#10

I know what you mean, but he still needs to provide the correct path to ‘header.php’ and if he specified the path incorrectly, as he did with the CSS file, he would still have the same task of modifying all the files that referenced ‘header.php’ to correct the path.

I understand your point of having certain things in an external include file, it’s very useful at times, but it makes no sense to have an external include file that only references an external CSS file.

How is this any different to having every page reference the CSS file, assuming the external include only contains the CSS reference? If he gets the path incorrect in either case he still has to modify every file to correct it.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)