Reply
css linking problems
Old 12-10-2004, 07:42 PM css linking problems
Junior Talker

Posts: 2
Hello. I'm not sure why, but I can't seem to link my main CSS into my seperate pages (like my index.html) and its becoming irritating because I would rather not make a seperate style sheet for every page. Could someone tell me how to do it. Also, should I name my CSS file main.css? Thanks!
DeathCheat is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 12-10-2004, 09:29 PM
Rincewind's Avatar
Super Talker

Posts: 108
There is more than one way to do this, but the simplest is to use code like this in between the <head> and </head> sections of your pages.
Code:
<link href="path/to/styles.css" rel="stylesheet" type="text/css" />
As for names, call the file whatevery you like.
__________________
Q-4.net - Reseller web hosting programs
Stylegallery.co.uk - Scottish Landscape Photography Gallery
Splodgy.com - Web design tutorials
Rincewind is offline
Reply With Quote
View Public Profile
 
Old 12-11-2004, 09:23 AM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
DeathCheat,

There should be no reason to make more than one style sheet unless you want to. Can you post your link out of your HTML file(s)?
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 12-12-2004, 11:46 PM
NateDogg's Avatar
Extreme Talker

Posts: 163
I would actually advise against writing different css files for each webpage as this negates the amazing ability that CSS has to change design over large areas of webspace.
__________________
Nathan

Become an affiliate
Web Design Web Hosting
NateDogg is offline
Reply With Quote
View Public Profile
 
Old 12-14-2004, 01:47 PM
Junior Talker

Posts: 2
What I mean is, i have one css file I want to use for all of my pages. The code i put in is as follows.

<html>
<head>
<link rel="stylesheet"
type="text/css"
href="main.css" />
</head>
</html>

I'm not sure why it deosn't want to work, but it's probably just a stupid midtake of mine. Could anyone tell me why it won't work? Thanks.
DeathCheat is offline
Reply With Quote
View Public Profile
 
Old 12-14-2004, 03:24 PM
NateDogg's Avatar
Extreme Talker

Posts: 163
Make sure that you have the main.css in the same folder as the html files and make sure your css file is correct, meaning that there is at least one rule in there and it is in correct syntax etc...

Your link statement looks fine to me.
__________________
Nathan

Become an affiliate
Web Design Web Hosting
NateDogg is offline
Reply With Quote
View Public Profile
 
Old 12-14-2004, 03:26 PM
karinne's Avatar
Extreme Talker

Posts: 197
Location: Quebec, Canada
you don't need the /> unless you're coding xhtml
__________________
a web design portfolio - blog - last.fm - del.icio.us - widow's walk

Getting on the Web Standards band-wagon? Get these books - Designing With Web Standards and Web Standard Solutions

Takin' in the view from the outside. Feeling like the underdog. Watching through the window I'm on the outside. Living like the underdog.
-Dream Theater
karinne is offline
Reply With Quote
View Public Profile Visit karinne's homepage!
 
Old 12-14-2004, 03:49 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Quote:
Originally Posted by karinne
you don't need the /> unless you're coding xhtml
This shouldn't cause an error, however. Neither should putting the different attributes of the tag on seperate lines, but just for discussion, have you tried putting the entire tag on one line?

The biggest issue, as Nate said, is to be sure your main.css is in the same directory as the file containing the CSS link directive. Otherwise, you need to specify the relative path.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Reply     « Reply to css linking problems
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.16012 seconds with 12 queries