when to leave space ,when not in CSS? -


It's OK (without space):

  li.highlight {background: # FF9900 No repeat scrolling 0 0; }  

This will not work (with space):

  li .highlight {background: # FF9900 scroll no repeat 0 0; }  

Why?

The latter selector will not work because in the relationship between the selectors in space (in this case a lineage) It means.

  li.highlight / * defines the element of 'li' with the classname 'heel' * / li. Highlight / * defines an element of the class highlights which is contained in the Li element. * / Li & gt; . Highlight / * As stated in Neil (in comments), it can choose an element of class highlight which is an immediate child / descendant of a li / * /  

The phrase "will not work." Obviously I used your phrasing, and I did it.

This will be work, it is just that it will select - explained in the comment - an element that you don 'is in your markup.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -