html - 我无法集中注意力让孩子影响父母
问题描述
我在 HTML 中有这段代码:
<div class="firstname-input">
<input type="text" id="firstname" name="firstname" placeholder="First name">
<button onclick="showName()"><figure></figure></button>
</div>
我想添加边框:2px solid #f90; 到.firstname-input,集中输入如果我写这个:
.firstname-input input:focus .firstname-input {
opacity: .1;
}
这是行不通的。
解决方案
利用
.firstname-input:focus-within {}
并添加您选择的样式
推荐阅读
- kubernetes - 使用 AdoptOpenJDK OpenJ9 在 Kubernetes 上拒绝 JMX 连接
- c# - 为什么在 Config 方法中解析我的服务时会出现异常?
- c++ - 在不知道模板参数的情况下使用基于 CRTP 的类作为函数的参数
- php - 从 Soap Response PHP 获取属性值
- java - h2数据库java堆问题
- python - Pywinauto 在网页上搜索文本并点击链接
- reactjs - react-hook-form material-ui 表单提交只工作一次
- python - GAN训练的难点
- spring-boot - Spring Boot PATCH MongoDB
- firebase - 为什么我会在具有公共访问权限的 Firestore 中获得 PERMISSION_DENIED ?