Thursday 25 April 2019

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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...