/    Sign up×
Community /Pin to ProfileBookmark

Creating CSS for all pages in a website

hello all….I have a site with many many pages and so it behooves me to create a CSS for the header and left and right navigation sections. I considered iframe but then read the horrors of search engines and framed sites SO I created a page in frontpage with the header and the navigation menus and named it “Style.css”. Then I uploaded the Style.css sheet to my web root directory and on a page i put

<head>
<link rel=”stylesheet” type=”text/css” href=”mywebsite/Style.css”>
</head>

and uploaded that page but when I view the page in a browser it does not display the .css elements. Am I oversimplifying this? Is there another step that I have not considered?

Thank you very much for any suggestions.

to post a comment
CSS

10 Comments(s)

Copy linkTweet thisAlerts:
@LeeUSep 15.2006 — Is there a reason you need the "mywebsite" link? If it's in the main directory, just write is as:
[CODE]
<link rel="stylesheet" type="text/css" href="Style.css">[/CODE]

You might want to consider putting it in a separate directory, i.e.
[CODE]
<link rel="stylesheet" type="text/css" href="/style/Style.css">[/CODE]

Also, make sure the capitalization is the same as the file.

If you're still having problems, could you provide a URL to the pages and the stylesheet?
Copy linkTweet thisAlerts:
@KDLASep 15.2006 — You also might check your CSS using a validator: http://jigsaw.w3.org/css-validator/

It could be that there is a problem "early on" in the CSS, preventing the rest from being applied.

KDLA
Copy linkTweet thisAlerts:
@webnewbieughauthorSep 15.2006 — wow that validator is a great little site...thank You! this is the error I received

Line: 8

Parse error - Unrecognized : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <meta name="generator" content="FontPage"> <style type="text/css"> .ws6 {font-size: 8px;}


Do you have any idea what about this creates an error or how to correct it? Thank you
Copy linkTweet thisAlerts:
@KDLASep 15.2006 — Can you send a link to the page you're testing? It would be easier to see it, than blindly guess the problem.

KDLA
Copy linkTweet thisAlerts:
@webnewbieughauthorSep 15.2006 — do you want to see the css page and the page that it should affect? or just the css page?
Copy linkTweet thisAlerts:
@KDLASep 15.2006 — The page you're using it on -- I can access the CSS from there, if needed.
Copy linkTweet thisAlerts:
@webnewbieughauthorSep 15.2006 — is there some way to post it here or provide you my email or something i just don't want to post it publicly on this site
Copy linkTweet thisAlerts:
@KDLASep 16.2006 — That's OK. Why don't you run the validator again, just to make sure that it wasn't a bug of the validator ("Parse error" could be a problem with it, than your stuff - I notice that no line number was given.) Then, if it has the same error mentioned, look at the explanation provided underneath the error statement. Report back to us, and we'll see if we can help you! ?

KDLA
Copy linkTweet thisAlerts:
@ray326Sep 16.2006 — Run it through the HTML validator first. That looks like possible HTML problems considering it says it's finding a doctype on line 8.

http://validator.w3.org/
Copy linkTweet thisAlerts:
@webnewbieughauthorSep 16.2006 — my God I got it to work! That is brilliant! Thank you very very much!
×

Success!

Help @webnewbieugh spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...