📌  相关文章
📜  选择单选按钮时更改 div 背景颜色 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:56.792000             🧑  作者: Mango

代码示例1
div.entry {
    position: relative;
    padding: 8px;
    width: 50%;
}
div.entry div.highlight {
    background-color: #fff;
    position: absolute;
    z-index: -1;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
}
div.entry input:checked ~ div.highlight {
    background-color: orange;
}

This is one option
This is another option
This is a third option