November 3, 200917 yr I can not find any reference to this in my tutorial sources, I know the hash means an id selector and that the div is a block level selector. But I do not understand what is happening below (even though I am using firefox and the web developer to understand. If the hash is a block level selector and the div also - why are they together in this second paragraph? #sidebar { float: left; width: 20%; display: inline; padding-bottom: 10px; } #sidebar div { padding: 20px; text-align: left; } #content { float: right; width: 80%; display: inline; padding-bottom: 10px;
November 3, 200917 yr '#sidebar div' is selecting a div within a div called 'sidebar'. An equivalent selector would be 'div#sidebar div' but since '#'s are more specific than html elements most people use '#sidebar div'. The space signifies more specificity. So if you wanted to target an anchor in a list that's in a div you could write '#Id ul li a.class' instead of 'a.class' which might refer to anchors used outside of '#Id'. Probably could have explained that better! source
November 4, 200917 yr Author '#sidebar div' is selecting a div within a div called 'sidebar'. An equivalent selector would be 'div#sidebar div' but since '#'s are more specific than html elements most people use '#sidebar div'. The space signifies more specificity. So if you wanted to target an anchor in a list that's in a div you could write '#Id ul li a.class' instead of 'a.class' which might refer to anchors used outside of '#Id'. Probably could have explained that better! source Hi and thanks. Understood the first para, sorry not the second para, I do know what class is i think, but did'nt understand really what you meant (not your fault - it's mine), but yeh. anyway you explained it better than 'source'- bit of an elitist language methinks, bit like trying to learn a foreign language by teaching school kids poetry and imperfective verb parsing, the human being works not like this.
Create an account or sign in to comment