View Full Version : CSS Newbie...
faint545
09-12-2007, 07:40 PM
I'm creating this web site and I've always been excellent with HTML, but not so much with CSS. Now, i've created a simple CSS file containing...
body {font-family: Trebuchet MS; font-size: 10px; color: #FFFFFF;}
Now, im like 95% positive that all of the syntax or w/e is all correct. But when I go to link it with my "index.html" file nothing works...
<link rel="stylesheet" type="css/text" href="stylesheet/default.css">
That's how I linked it... I don't see anything wrong... [i dunno why but the backslashes were added in..]
ALSO...
How do I get the stylesheet attributes to apply inside tables?
mairving
09-12-2007, 08:50 PM
Assuming that you have the path correct that should work okay. You can check that by doing an inline stylesheet (between style tags in your head section.
That will work in tables unless you create another class or id that overrides it like so
td{font-family: Trebuchet MS; font-size: 10px; color: #000000;}
or
td.blackfont{font-family: Trebuchet MS; font-size: 10px; color: #000000;}
<td class="blackfont">Some text here</td>
Bookmark A List Apart (http://www.alistapart.com/) as one of the best sites for CSS.
blue60007
09-12-2007, 10:40 PM
If this is plain HTML take out the escape characters and just use the quotations.
I just did a test with a link and using the escape characters screws up the URL. Your browser reading the HTML won't read the \ as an escape character - it looks like it's handling it as part of the URL and making the link something goofy like \http://www.somesite.com/\ ... Probably why your stylesheet link isn't working. Now...if you are echoing this from PHP, than there shouldn't be a problem. If this is being printed dynamically from PHP take a look at the source code provided from your browser and make sure the link doesn't look bonkers.
mairving
09-12-2007, 11:50 PM
If this is plain HTML take out the escape characters and just use the quotations.
I just did a test with a link and using the escape characters screws up the URL. Your browser reading the HTML won't read the \ as an escape character - it looks like it's handling it as part of the URL and making the link something goofy like \http://www.somesite.com/\ ... Probably why your stylesheet link isn't working. Now...if you are echoing this from PHP, than there shouldn't be a problem. If this is being printed dynamically from PHP take a look at the source code provided from your browser and make sure the link doesn't look bonkers.
I think he meant that the quotes were escaped when you use the HTML tags here. I assume that they weren't escaped on his site.
faint545
09-13-2007, 12:14 AM
yeah the escape characters were added in after i posted the topic.. the things messed it up.. but i figured it out.. as i found out... where i had.. <...type="css/text"...> it should if been <...type="text/css"...> not sure why it's picky but after i switched it, it worked just fine.
blue60007
09-13-2007, 12:36 AM
Ahh...I see. Probably how the forum stores them in the database. Glad you found the problem though, it's always those little annoying mistakes.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.