Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
bradley_taunt
on July 23, 2020
|
parent
|
context
|
favorite
| on:
Why is CSS the way it is?
You're correct about not being able to target parent selectors without some JS intervention - BUT - if you avoid any property declarations on your default img elements you can achieve what you desire.
Live demo:
https://codepen.io/bradleytaunt/pen/LYGapao
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Live demo: https://codepen.io/bradleytaunt/pen/LYGapao