PDA

View Full Version : Which one is correct CSS?



SilverFrog
17 Jun 2009, 03:22 PM
Which one of these is correct CSS:


#content input, textarea,
or

#content input, #content textarea,

both seem to work, but which one is better and/or more correct?

Alan
17 Jun 2009, 05:25 PM
They are both correct and different.

In the first one, you are referring to every textarea element. In the second one, only a textarea element located within a content id. Which to use is dependant on whether the textarea in the content id is unique or you want to refer to the global tag.