View Full Version : specifity

08-23-2005, 10:01 PM
Is this css declaration ...

div#firstDivie ul#unorderListlistOfFirstDivie li {
height: 50px;

the same as the one here under:

ul#unorderListlistOfFirstDivie li {
height: 50px;

Is the first one on higher specifity ... ?

08-23-2005, 10:35 PM
Since your using ID's I would use the second one. There should only be one element per ID so those 2 do the same thing.

08-23-2005, 10:40 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<style type="text/css">
div#firstDivie ul#unorderListlistOfFirstDivie li
ul#unorderListlistOfFirstDivie li
<div id="firstDivie">
<ul id="unorderListlistOfFirstDivie">
This text should show what selector has higher specifity.
</html>This shows the first has higher specifity.

08-23-2005, 10:57 PM
This shows the first has higher specifity.

And does nothing to explain why! :thumbsup: Typical hemebondian post, no big deal.

Check these out:


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum