Ana Tudor 🐯 on Nostr: #tinyCSStip One thing that has always annoyed me about `:empty` is that it doesn't ...
#tinyCSStip One thing that has always annoyed me about `:empty` is that it doesn't work for elements that have text content, but no element children.
`:has()` fixes this problem.
`:not(:has(*))` selects elements that don't have element children, even if they have text content.
#CSS #code #coding #frontend #webDev #webDevelopment
Published at
2024-03-12 09:18:47Event JSON
{
"id": "9e9c4b5f39704f85dae6f34b4ce9c51a8250ba956d3a265ebabd129ecb86f725",
"pubkey": "708789c2b324d71ee51c3818622526e1eda1f6ebd9a9ffeba1f09554be3a2562",
"created_at": 1710235127,
"kind": 1,
"tags": [
[
"t",
"tinyCSStip"
],
[
"t",
"css"
],
[
"t",
"code"
],
[
"t",
"coding"
],
[
"t",
"frontend"
],
[
"t",
"webdev"
],
[
"t",
"webdevelopment"
],
[
"proxy",
"https://mastodon.social/users/anatudor/statuses/112081969319447463",
"activitypub"
]
],
"content": "#tinyCSStip One thing that has always annoyed me about `:empty` is that it doesn't work for elements that have text content, but no element children.\n\n`:has()` fixes this problem.\n\n`:not(:has(*))` selects elements that don't have element children, even if they have text content.\n\n#CSS #code #coding #frontend #webDev #webDevelopment\n\nhttps://files.mastodon.social/media_attachments/files/112/081/964/470/924/656/original/c656502a7d2b6fbf.png",
"sig": "227b3609eb0d421782feddcfcedf3d0f01a6f88b7f6c77c57689c812fac2dd63ab7a445d64482ac1010181a819d718ec3e9a961f294251f59a1690d8f855cfcd"
}