Anyone know if its possible to select an element by class AND id?
<?php
$class = ( TRUE )?("showMe"):("hideMe)";
echo "<div id=\"foo\" class=\"{$class}\"> Look its a div! </div>
";
?>
i need to access div#foo and then if div#foo has class hideMe use display:none; the showMe class is erroneous.
something like this (i know it doesnt work)
div#foo {
/* styles */
}
div#foo.hideMe {
display: none;
}
any ideas?
also, if anybody has ins with w3c i have a thought for a new CSS standard. Give rules => attributes the ability to be referenced. example (phpish syntax):
body {
margin: 0px auto;
background-color: #fff;
font-family: Arial, Helvetica, Sans-Serif,
font-size: 12px;
color: #000;
border: 1px solid #0a0;
}
div.classy {
/* would match background-colors /*
background-color: {body::this};
/* would pull border-color attribute from the body rule /*
color: {body::border-color};
}
i think making CSS more operable might be a good move? any thoughts?