Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 10, 2013 02:32 AM by dahla
Member
141 Points
280 Posts
Feb 09, 2013 10:43 PM|LINK
I am reading a book and it has something like that:
input#web { background-image: url("images/web.png");}
I didnt know I could use input#web..
#web already defines that we are styling an elemento of idedity web, So the input its not necessary.
Since we cant have multiples idenditys, i dont understande the use of the input here.
Participant
1816 Points
369 Posts
Feb 10, 2013 02:32 AM|LINK
As you point it in your case, it does not make much sense unless somebody has by accident used the same id twice in a page.
But if you look at this page http://www.w3.org/TR/CSS21/cascade.html#specificity you can see that it sometimes makes sense to add more selector in order to increase the specificity
anderson7777
Member
141 Points
280 Posts
Doubt about CSS code
Feb 09, 2013 10:43 PM|LINK
I am reading a book and it has something like that:
input#web {
background-image: url("images/web.png");}
I didnt know I could use input#web..
#web already defines that we are styling an elemento of idedity web, So the input its not necessary.
Since we cant have multiples idenditys, i dont understande the use of the input here.
dahla
Participant
1816 Points
369 Posts
Re: Doubt about CSS code
Feb 10, 2013 02:32 AM|LINK
As you point it in your case, it does not make much sense unless somebody has by accident used the same id twice in a page.
But if you look at this page http://www.w3.org/TR/CSS21/cascade.html#specificity you can see that it sometimes makes sense to add more selector in order to increase the specificity