【发布时间】:2023-03-16 05:40:02
【问题描述】:
我怎样才能让它专注于输入来改变文本的背景颜色..? 我到底做错了什么? 请告诉我.. 谢谢
.parent_div {
background: lightblue;
.child_div {
input {
color: grey;
background: blue;
&:focused {
color: purple;
background: white;
}
&:focused~grand-child-of-parent {
opacity: 0.7;
background: red;
}
}
}
}
<div class="parent_div">
<div class="first_child">
<input type="text" />
</div>
<p class="second_child"> is simply dummy text of the printing and typesetting industry.</p>
</div>
【问题讨论】: