本帖最后由 sukiwhip 于 2019-5-28 18:35 编辑 <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
* {
margin: 0px;
padding: 0px;
}
.page-left {
min-height: 1000px;
width: 60%;
height: 100%;
background-color: #22c3aa;
float: left;
transition: background-color 1s;
}
.left-dis {
text-align: right;
margin-right: 10px;
margin-bottom: 20px;
color: white;
font-size: 50px;
font-weight: 500px;
transition: color 1s;
}
.left-title {
margin-right: 20px;
height: 200px;
width: auto;
font-size: 20px;
display: block
}
.ul-left {
list-style: none;
height: 100%;
width: 70%;
}
.page-right {
min-height: 1000px;
width: 30%;
height: 100%;
background-color: white;
transition: background-color 1s;
float: left;
}
.right-dis {
font-size: 50px;
margin-bottom: 20px;
font-weight: 500px;
margin-left: 5px;
color: #22c3aa;
transition: color 1s;
}
.right-title {
display: inline-block;
font-size: 20px;
}
.ul-right {
list-style: none;
height: 100%;
width: 30%;
}
.page-left:hover {
background-color: white;
}
.page-left:hover .left-dis {
color: #22c3aa;
}
.page-left:hover+.page-right {
background-color: #22c3aa
}
.page-left:hover+.page-right>.right-dis {
color: white
}
</style>
</head>
<body>
<div class="page-left">
<p class="left-dis">小树苗的</p>
<span class="left-dis left-title">
<!--就是这里的span,设置了display和宽高,但是css中的margin-right为何会在父元素标签范围以外-->
<p>坦格利安家族的"风暴降生"</p>
<p>铁王座</p>
<p>安达尔人和先民的</p>
<p>七大王国守护者</p>
<p>大草海上的</p>
<p>不焚者镣铐</p>
</span>
<ul class="ul-left">
<li>左</li>
<li>左</li>
<li>左</li>
<li>左</li>
</ul>
</div>
<div class="page-right">
<p class="right-dis">成长相册</p>
<span class="right-dis right-title">
<p>Daenerys</p>
<p>Lawful hei</p>
<p>Queen</p>
<p>Mother of Dragen</p>
<p>Khaleesi</p>
<p>Breaker</p>
</span>
<ul class="ul-right">
<li>右边</li>
<li>右边</li>
<li>右边</li>
<li>右边</li>
<li>右边</li>
</ul>
</div>
</body>
</html>
是想要这个效果? |