Buffy84
04-09-2006, 12:27 AM
I feel pretty stupid right now. So many people have probably asked this already, but i just can't seem to figute it out.
I'm trying to link to an external style sheet. It's in the same folder as my html document.
This is the code I put in my html document:
<head>
<LINK href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
My style sheet I just called : stylesheet
Please help me someone!!!!
Marta
04-09-2006, 02:20 AM
is it called stylesheet.css ?
J to the izzosh
04-09-2006, 05:35 PM
You don't have any HTML tags in your external style sheet, do you? Like <style>?
J to the izzosh
04-09-2006, 06:22 PM
Yes, those are only used in an actual HTML to tell the browser what should be read as CSS; they aren't actually CSS. What this means if you have them in a CSS file is that because the browser already thinks that everything in that file should be CSS, it will try to read everything as CSS. Those tags mess up the way the browser tries to parse the CSS file, because they are HTML. Try removing them.
Buffy84
04-09-2006, 09:01 PM
I tried. Still won't work.
J to the izzosh
04-10-2006, 04:54 AM
Try posting a link to your site so that we can take a look at your actual source and attempt to troubleshoot the problem. Otherwise, all we can do is make blind conjecture.
A side thought to grammar afficionados: Is the term "blind conjecture" redundant?
Buffy84
04-10-2006, 05:06 AM
My page isn't online yet.
What I wrote on my html page is :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<LINK href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
and the stylesheet is called "stylesheet.css"
It should work!
J to the izzosh
04-10-2006, 05:21 AM
Yes, it should, so long as the style sheet is in the same directory as the HTML file. If it doesn't work, then there's something wrong with either the style sheet itself, or the HTML to which it is being applied.
On a side note, your element names should be written in lowercase and you should close any empty tags with a "/" at the end of it:
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
Buffy84
04-10-2006, 07:18 PM
It worked! Woohoo!:waves: Thanx a lot!!!!!!!! :princess:
J to the izzosh
04-11-2006, 04:15 AM
Wait, what worked?
I mean, "Go team!"
Buffy84
04-12-2006, 06:19 PM
I don't really undersand everything about CSS yet. Like, how can it work in the same way as frames??? Can I use CSS so I don't have to repeat the banner and menu on every page?? I have used css for the frontpage.I'm not sure what to do with the rest of the pages. Any ideas about what I can do???
http://www.alantudyk.cjb.net/
J to the izzosh
04-13-2006, 04:28 AM
how can it work in the same way as frames???
It can't. CSS doesn't define content, it only influences the way in which it is displayed. You can't use CSS to say, "hey, this should be a frame", only "this should look like this". You can't achieve the functionality of frames through CSS because frames rely on loading multiple documents into different sections of a window, while CSS just styles a single document at a time. There's nothing stopping you from using frames in conjunction with CSS, though, so if you want the functionality of not having to reload a separate navigation pane when you go between pages, just use frames. That, or something crazy like AJAX, but that's a whole other can of worms, that is.