Boyah Forums

General => The Lobby => Topic started by: Terran SCV on December 23, 2008, 08:47:43 PM

Title: CSS
Post by: Terran SCV on December 23, 2008, 08:47:43 PM
CSS is not working offline.

Or did I just include the wrong DOCTYPE? Geez, I'm sooo frustrated....

Here it is
Code Select

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
p.line1 { border-top: 2px shaded #0000FF;}

p { font-color: #0000FF;}
</style>
<body>
<p>Test</p>
<p class="line1"></p>

When I open the page, the line doesn't appear. Neither does the color of the text change. Please help me!
Title: Re: CSS
Post by: Daddy on December 23, 2008, 08:55:40 PM
You didn't close the <head> tag, nor the html or body tags. Maybe that's the problem.

Also using an external stylesheet is a better practice.
Code Select
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<?php         echo "<title>$title</title>"?>
         <link rel="stylesheet" type="text/css" href="css/style.css">
<?php         echo "$includes";  ?>
         <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
All the shit I have in the body here
</body>
</html>

Is the genral structure of my page.
Ignore the PHP stuff, that just uses a variable for the title instead of a static one, and  $includes is optional Javascript.
Title: Re: CSS
Post by: Terran SCV on December 23, 2008, 09:05:16 PM
It still doesn't work
:(

I'm going to try on Ubuntu
see ya soon
Title: Re: CSS
Post by: Daddy on December 23, 2008, 09:07:47 PM
Try just 'color' instead of 'font-color'
Title: Re: CSS
Post by: Terran SCV on December 23, 2008, 09:19:31 PM
Quote from: Frutta Procione on December 23, 2008, 09:07:47 PM
Try just 'color' instead of 'font-color'

That isn't my main problem ATM but okay
Title: Re: CSS
Post by: Daddy on December 23, 2008, 09:30:44 PM
Quote from: Terran SCV on December 23, 2008, 09:19:31 PM
That isn't my main problem ATM but okay
what is the problem
Title: Re: CSS
Post by: Terran SCV on December 23, 2008, 09:32:25 PM
Quote from: Frutta Procione on December 23, 2008, 09:30:44 PM
what is the problem

Bottom line: CSS isn't working at all, even on Ubuntu.
Title: Re: CSS
Post by: Daddy on December 23, 2008, 09:33:44 PM
Quote from: Terran SCV on December 23, 2008, 09:32:25 PM
Bottom line: CSS isn't working at all, even on Ubuntu.
Just your CSS or any CSS?

Title: Re: CSS
Post by: Terran SCV on December 23, 2008, 09:37:28 PM
Quote from: Frutta Procione on December 23, 2008, 09:33:44 PM
Just your CSS or any CSS?



What the frak

I tried
Code Select

body { margin: 2em;}


and it worked     baddood;

What's wrong? Should I use border-bottom instead?


EDIT: It works now. Odd.
I blame Microsoft.
Title: Re: CSS
Post by: Terran SCV on December 23, 2008, 09:40:04 PM
Thanks JMV  :3
Title: Re: CSS
Post by: bluaki on December 23, 2008, 11:41:20 PM
You're using XHTML, so you have to close everything. Even the meta tag.
Code Select

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
p.line1 { border-top: 2px shaded #0000FF;}

p { color: #0000FF;}
</style>
</head>
<body>
<p>Test</p>
<p class="line1"></p>
</body>
</html>

If you were using standard HTML as the doctype, it'd probably work as is.
Oh, and like JMV said, font-color is not a css attribute. Use "color" instead.