关于鼠标滑过以及三角形的问题
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>2-10作业</title>
<style type="text/css">
*{padding:0;
margin:0;
font-family: ' Microsoft YaHei UI';
}
.tb{
position: fixed;
width: 100%;
height: 80px;
background-color:#07cbc9;
z-index: 5;
}
.tb .logo{
float: left;
}
.tb .dh{float: right;}
.tb .logo img{
width: 220px;
height:60px;
padding-top:10px;
padding-left:100px;
}
.dh ul li {
float: left;
list-style: none;
padding-top: 30px;
padding-right:30px;
}
a{
text-decoration:none;
font-weight: bold;
color: #ffffff;
font-size: 16px;
}
a.dh1:hover{background-color: red;}
.banner img{
width: 100%;
height: 750px;
}
.banner .zhezao{
position:absolute;
float: right;
top:80px;
left: 0;
background:black;
width: 100%;
height:670px;
z-index:2;
opacity:0.2;
}
.bd{
width: 600px;
height: 280px;
position: absolute;
z-index: 2;
top: 340px;
margin-top: -140px;
right: 50%;
margin-right: -300px;
}
.bd .form{
text-align: center;
}
.bd .form input{
font-size: 18px;
margin:10px auto;
border:2px solid grey;
font-weight: bolder;
color:grey;
}
.bd .form textarea{
font-size: 18px;
margin:10px auto;
border:2px solid grey;
font-weight: bolder;
padding-top: 10px;
}
a.bd1:hover input{
background-color: #07cbc9;
border:2px solid #07cbc9;
}
a.bd1:hover textarea {
background-color: #07cbc9;
border:2px solid #07cbc9;
}
a.tj1:hover input{
background-color: #07cbc9;
border: none;
}
a.tj1:hover {
background-color: #07cbc9;
}
.about1{
width: 100%;
height:150px;
background-color: #ffffff;
}
.hl{
text-align: center;
font-weight: bolder;
font-size: 40px;
margin-top: 25px;
}
.hr{
width: 40px;
margin:10px auto;
background: #07cbc9;
border: 1.5px solid #07cbc9 ;
}
.wz{
color:grey;
padding-top:5px;
font-size: 15px;
width: 500px;
height: 60px;
margin:0 auto;
text-align: center;
}
.img1{
text-align: center;
margin-top: 20px;
}
.ablut2{
position: relative;
width:100%;
height: 500px;
background-color: #fff;
z-index: 999;
}
.img1 img{
width: 568px;
height: 380px;
}
.wz2{
position:absolute;
width: 200px;
height: 50px;
text-align: center;
top: -10px;
margin-top: 25px;
right: 50%;
margin-right:270px;
font-size:25px;
}
.bkwz{
position: absolute;
width: 370px;
height: 246px;
background-color:rgba(0,0,0,0);
border:1px solid grey;
top: 100px;
right:50%;
margin-right:168px;
}
.bkwz p{
margin-top: 30px;
margin-left: 25px;
}
.an input{
border:1px solid #000000;
color: #ffffff;
margin-top: 20px;
margin-left: 30px;
}
.bkwz1{ position: absolute;
float: right;
border: 1px solid #07cbc9;
width: 238px;
height: 144px;
margin-top:-50%;
top: 104px;
margin-left:100%;
left: 500px;
}
.ablut-wz{
font-size:30px;
text-align: center;
margin-top: 20px;
}
.ablut-hr{
width: 40px;
margin:10px auto;
background: #07cbc9;
border: 1.5px solid #07cbc9 ;
}
.ablut-wz1{
font-size: 16px;
text-align: center;
margin-top:13px;
}
.bkwz2{
position: absolute;
float: right;
border: 1px solid #07cbc9;
width: 238px;
height: 144px;
margin-top:-50%;
top: 280px;
margin-left:100%;
left: 500px;
}
.ablut3{
position: relative;
width: 100%;
height: 558.4px;
background-color: red;
z-index: 999;
}
.twhh img{
float: left;
width: 25%;
height: 279.2px;
}
.twhh-t{
float: left;
width: 25%;
height: 279.2px;
background-color: #07cbc9;
}
.ms{
font-size: 25px;
color: #ffffff;
padding-top: 20px;
padding-left: 25px;
}
.ms1{
font-size: 15px;
color: #fff;
padding-top:12px;
padding-left:25px;
}
.ms2{
font-size:12px;
color: grey;
padding-top:10px;
padding-left:25px;
}
.an1{
text-align: center;
margin-top: 20px;
}
.an1 input{
border: none;
color: #ffffff;
font-size:15px;
}
a.x:hover input {
border: 5px solid red;
background-color:rgba(0,0,0,0);
}
.sjx{
width: 0;
height: 0;
border-style: solid;
border-width: 20px;
border-color:rgba(0,0,0,0) #07cbc9 rgba(0,0,0,0) rgba(0,0,0,0);
}
</style>
</head>
<body>
<!-- 头部 -->
<div class="tb">
<div class="logo">
<a href="#"><img src="images/logo.png"></a>
</div>
<div class="dh">
<ul>
<li><a class="dh1" href="#">HOME</a></li>
<li><a class="dh1" href="#">ABOUT</a></li>
<li><a class="dh1" href="#">GALLERY</a></li>
<li><a class="dh1" href="#">FACULTY</a></li>
<li><a class="dh1" href="#">EVENTS</a></li>
<li><a class="dh1" href="#">CONTACT</a></li>
</ul>
</div>
</div>
<!-- banner图 -->
<div class="banner">
<img src="images/banner3.jpg">
<div>
<div class="zhezao"></div>
<div class="bd">
<form class="form">
<a class="bd1"><input type="text" name="a" placeholder=" you Name" style="width:505px;height: 39px; background:none; " ><br>
<input type="text" name="b" placeholder=" you Phone" style="width:505px;height: 39px;background:none"><br>
<input type="text" name="c" placeholder=" you Email" style="width:505px;height: 39px;background:none"><br>
<textarea name="d" placeholder=" Write Your Comment Here" style="width:505px;height: 115px;background:none;color: #ffffff" a></textarea></a>
<a class="tj1"><input type="submit" name="e" value=" SEND MESSAGE" style="width:200px;height: 43px;background:none"></a>
</form>
</div>
</div>
</div>
<!-- ABOUT区上部分 -->
<div class="about1">
<div class="hl">
ABOUT
<hr class="hr">
</div>
<div class="wz">
Lorem Ipsum is dummy text of the printing and typesetting<br>
industry. Lprem Ipsum has been the indust's standard dummy<br>
text ever since the 1500s.
</div>
</div>
<!-- ABOUT区中部分 -->
<div class="ablut2">
<div class="wz2">A WORD<br>ABOUT US
</div>
<div class="img1">
<img src="images/bb3.jpg">
</div>
<div class="bkwz">
<p>Praesesnt dingnissim viverra est,seb<br>
bibendum ligula congue non, seb ac nisl<br>
et felis gravida commodo? Suspendisse<br>
eget ullamcorper ipsum.Suspendisse<br>
diam amet.<br></p>
<div class="an">
<form>
<a class="an2"><input type="submit" name="e" value="EXPLORE" style="width:102px;height: 45px;background-color: #000000"></a>
</form>
</div>
<div class="bkwz1">
<div class="ablut-wz">
70000
<hr class="ablut-hr">
</div>
<div class="ablut-wz1">Students</div>
</div>
<div class="bkwz2">
<div class="ablut-wz">
600
<hr class="ablut-hr">
</div>
<div class="ablut-wz1">Faculty</div>
</div>
</div>
</div>
<!-- ABOUT区下部分 -->
<div class="ablut3">
<div class="twhh">
<img src="images/b1.jpg">
<div class="twhh-t">
<p class="ms">Library</p>
<p class="ms1">Lorem Ipsum is simply dummy text of the<br>
printing and typesetting inbustry
</p>
<p class="ms2">Lorem Ipsum has been the industry's standard dummy<br>
text ever since the 1500s, when an unknown printer took<br>galley of type and scrambled it to make a yupe<br>specimen book.
</p>
<form class="an1">
<a class="x"><input type="submit" name="e" value="EXPLORE" style="width:110px;height: 40px;background-color: #000000"></a> </form>
</div>
<img src="images/b2.jpg">
<div class="twhh-t">
<p class="ms">Library</p>
<p class="ms1">Lorem Ipsum is simply dummy text of the<br>
printing and typesetting inbustry
</p>
<p class="ms2">Lorem Ipsum has been the industry's standard dummy<br>
text ever since the 1500s, when an unknown printer took<br>galley of type and scrambled it to make a yupe<br>specimen book.
</p>
<form class="an1">
<a class="x"><input type="submit" name="e" value="EXPLORE" style="width:110px;height: 40px;background-color: #000000"> </a> </form>
</div>
<div class="twhh-t">
<p class="ms">Library</p>
<p class="ms1">Lorem Ipsum is simply dummy text of the<br>
printing and typesetting inbustry
</p>
<p class="ms2">Lorem Ipsum has been the industry's standard dummy<br>
text ever since the 1500s, when an unknown printer took<br>galley of type and scrambled it to make a yupe<br>specimen book.
</p>
<form class="an1">
<a class="x"><input type="submit" name="e" value="EXPLORE" style="width:110px;height: 40px;background-color: #000000"> </a> </form>
</div>
<img src="images/b3.jpg">
<div class="twhh-t">
<p class="ms">Library</p>
<p class="ms1">Lorem Ipsum is simply dummy text of the<br>
printing and typesetting inbustry
</p>
<p class="ms2">Lorem Ipsum has been the industry's standard dummy<br>
text ever since the 1500s, when an unknown printer took<br>galley of type and scrambled it to make a yupe<br>specimen book.
</p>
<form class="an1">
<a class="x"><input type="submit" name="e" value="EXPLORE" style="width:110px;height: 40px;background-color: #000000 " > </a></form>
</div>
<img src="images/b4.jpg">
</div>
</div>
<div class="sjx"></div>
<!-- GALLERY区 上部分-->
<!-- GALLERY区 中部分-->
<!-- GALLERY区 下部分-->
<!-- 页脚区 -->
</body>
</html>
鼠标划过效果其他都能实现就是背景颜色变透明这个效果出不来

三角形能够做出来了 就是搞不清楚该如何放上去
正在回答
同学你好,
1、在鼠标移入时,背景颜色没有变透明,是因为同学把背景颜色写在了标签内(行间样式),权重比较高导致的。
建议:可以把背景颜色写在style标签里面。
例子:


2、小三角可以使用伪类实现,在布局时img标签添加一个父级。小三角相对于父级定位



第二排的小三角再调整一下位置就可以了。
如果帮助到了你,欢迎采纳~祝学习愉快~
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧