Wednesday, 6 July 2016

css selector for td with an input element










How would I make a css selector with that applies style to a table cell that has an input child element?


Answer



Unfortunately, you can't target parent elements in CSS yet (I believe it will come in CSS3)(see Sam's answer). If you want to do this, you'll either have to a) use javascript or b) add a class name to the td containing the input.




Here is a nice reference of the selectors you can use currently to target children, siblings, types, etc.


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...