I need to change the width of an element only when a child has the id="detail"
so in my css I do this:
.ui-dialog:has(#detail){
width: 51em !important;
}
But It is not work. Anyone can help me?
I need to change the width of an element only when a child has the id="detail"
so in my css I do this:
.ui-dialog:has(#detail){
width: 51em !important;
}
But It is not work. Anyone can help me?
2
Answers
If you want to use JS, here’s what you need to do to change the width of an element if its child has
id="detail"
:In this example if there is no child with id detail the color is red but when the child is created and added to our existing List then it uses :has() css