Kage Kazumi
10-22-2012, 10:43 PM
div#somediv h1{
background-color:#000;
}
Now the above is just an example, but I saw someone typing CSS that way (and have seen it many times), but I can never get it to work. I always have to use something like:
h1{
background-color:#000;
}
Does it have something to do with my DOC type for the html you think?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
CSS header file would say:
@charset "utf-8";
/* CSS Document */
background-color:#000;
}
Now the above is just an example, but I saw someone typing CSS that way (and have seen it many times), but I can never get it to work. I always have to use something like:
h1{
background-color:#000;
}
Does it have something to do with my DOC type for the html you think?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
CSS header file would say:
@charset "utf-8";
/* CSS Document */