Page 1 of 1

My external CSS is not working for ID stlyes

Posted: Sun Dec 26, 2004 12:48 pm
by Chris Corbyn
Merry xmas everybody!

Just getting stressed with my css (setting styles for ID's) in an external css file.

For some reason if I use .someclass {somesettings} with class="someclass" in the attributes it works.

But if I use #someID {somesettings} with id="someID" in my attribute it ignores the CSS.

Heres my tow simple pages. Sorry if this is blindly obvious to anyone... it should be to me but I've been lookin at it for ages getting stressed (too many xmas drinks I suppose :-) )

HTML doc:

Code: Select all

<?php

session_start();

$loc = $_GET['loc'];
if (!$loc) {
	$loc = 'index';
}

switch ($loc) {
	case 'index' : {
		$current_title = 'Welcome';
		break;
	}
}
	
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="Stylesheet" type="text/css" href="style.css">
<title>Email Application - <?php echo $current_title; ?></title>
</head>
<body>
<table width="100%" height="560" cellpadding="0" cellspacing="0" border="1">
	<tr>
		<td colspan="2" id="header">Header</td>
	</tr>
	<tr>
		<td colspan="2" id="options">Icons here</td>
	</tr>
	<tr>
		<td rowspan="2" id="folderlist">Folders</td>
		<td id="messages">Messages</td>
	</tr>
	<tr>
		<td id="preview">Preview</td>
	</tr>
	<tr>
		<td colspan="2" id="actions">Actions</td>
	</tr>
</table>
</body>
</html>
and the css file....

Code: Select all

#folderlist (
	width:180px;
&#125;
the weird thing is if I change the " # 2 in my css file to a " . " and change id="folderlist" to class="folderlist" it works.

Re: My external CSS is not working for ID stlyes

Posted: Mon Dec 27, 2004 6:48 am
by zenabi
d11wtq wrote: and the css file....

Code: Select all

#folderlist (
	width:180px;
&#125;
You have a ( instead of a { . Once that is changed it should work (tested on IE6 and Firefox).