老师你看下我的banner区 为什么我的鼠标经过边框无反应
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>作业</title>
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="header">
<div class="logo">
<img src="images/logo.png">
</div>
<div class="nav">
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">ABOUT</a></li>
<li><a href="#">GALLERY</a></li>
<li><a href="#">FACULTY</a></li>
<li><a href="#">EVENTS</a></li>
<li><a href="#">CONTACT</a></li>
</ul>
</div>
</div>
<div class="banner">
<div class="img">
<img src="images/banner3.jpg">
</div>
<div class="topLayer">
<div class="topLayer-top">
<form>
<input type="text" placeholder="your Name" ><br>
<input type="text" placeholder="your Phone" ><br>
<input type="text" placeholder="your Email" ><br>
<textarea placeholder="Write Your Comment Here" ></textarea>
</form>
</div>
</div>
</div>
<div class="ABOUT"></div>
<div class="GALLERY"></div>
<div class="footer"></div>
</body>
</html>
css:
*{
padding:0;
margin: 0;
}
html,body{
font-family: "Microsoft YaHei UI";
}
.header{
width: 100%;
height:80px;
background-color: #07cbc9;
position: absolute;
}
.header img{
height: 48px;
width: 260px;
}
.header .logo{
float: left;
padding-top: 16px;
padding-left:100px;
}
.header .nav{
float: right;
padding-right: 100px;
}
.header .nav li{
font-family: "Microsoft YaHei UI";
float: left;
line-height: 80px; /*使字体水平居中*/
padding-right: 30px;
list-style-type: none;
color: white;
font-weight: bold;
}
a{
text-decoration: none; /*清除下划线*/
}
a:link{
color: white;
}
li:hover{
background-color: black;
}
.banner img{
padding-top: 80px;
height: 650px;
width: 100%;
}
.banner .topLayer{ /*遮罩层*/
position: absolute;
left: 0;
top: 80px;
height: 650px;
width: 100%;
background-color: black;
opacity: 0.5;
}
.banner .topLayer .topLayer-top{
height: 400px;
width: 600px;
/*background-color: lightcoral;*/
position: absolute;
top: 50%;
margin-top: -200px;
left: 50%;
margin-left: -300px;
}
.banner .topLayer .topLayer-top form input{
font-family: "Microsoft YaHei UI";
height: 40px;
width: 500px;
border: 2px solid #666;
margin-top: 20px;
padding-left: 10px;
background: transparent ;
}
.banner .topLayer .topLayer-top form textarea{
font-family:"Microsoft YaHei UI";
width: 500px;
height: 90px;
margin-top:20px;
border: 2px solid #666;
padding-left: 10px;
padding-top: 10px;
background: transparent ;
}
input:hover{
border-color:#07cbc9;
}
textarea:hover{
border-color:#07cbc9;
}
.banner .topLayer form{
padding-left: 40px;
}
而且 我输入框背景颜色用的 transparent
然后输入的字不见了
正在回答
hover前面补全,背景颜色用rgba()即可,a指的是透明度,尝试一下,如果解答了你的疑惑,望采纳!
我在这个http://class.imooc.com/course/qadetail/61448链接中为你回复了。祝学习愉快~
- 参与学习 人
- 提交作业 1088 份
- 解答问题 10205 个
如果你有Java语言基础,又想以后从事Java Web开发,那么本路径是你的不二选择!本路径从网页搭建开始入手,通过大量案例来学习Java Web基础。定能助你完成Java Web小白的蜕变!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星