老师 请问这个伪元素和子盒子是相同的对吧
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
}
.big {
width: 100%;
}
.f11,.f13,.f22,.f24 {
width: 25%;
float: left;
height: 380px;
}
.f12,
.f14,
.f21,
.f23 {
background-color: rgb(15, 151, 124);
height: 380px;
width: 25%;
float: left;
position: relative;
}
img {
width: 100%;
height: 100%;
display: block;
}
.title {
font-size: 24px;
/* 中间的这个20为什么显示的是左边而不是右边嗯? */
margin: 20px 20px 30px;
font-weight: 700;
color: white;
}
.intro {
margin: 0 20px 20px;
font-size: 16px;
color: white;
}
.berief {
margin: 0 20px 30px;
font-size: 14px;
color: gray;
}
.btn {
display: block;
color: white;
margin: 0 auto;
width: 138px;
height: 40px;
background-color: black;
border: noen;
}
.f12::after, .f14::before {
content: "";
height: 0;
width: 0;
border: 20px solid transparent;
border-right-color: aquamarine;
position: absolute;
top: 50%;
margin-top: -20px;
left:-40px;
}
.f21::after, .f23::before {
content: "";
height: 0;
width: 0;
border: 20px solid transparent;
border-left-color: aquamarine;
position: absolute;
top: 50%;
margin-top: -20px;
right:-40px;
}
</style>
</head>
<body>
<div class="big">
<div class="f11">
<img src="/盒模型/浮动/定位/images/b1.jpg" alt="" />
</div>
<div class="f12">
<div class="rec1"></div>
<div class="title">Library</div>
<div class="intro">
lorem ipsum is simply dummy text of the printing and typesetting
industry. loremipsum
</div>
<div class="berief">
lorem ipsum is simply dummy text of the printing and typesetting
industry. loremipsum. Wan xiao peng yi ding hui jin da chang de.Qing
wu bi xiang xin.
</div>
<button class="btn">EXPLORE</button>
</div>
<div class="f13"> <img src="/盒模型/浮动/定位/images/b2.jpg" alt=""></div>
<div class="f14">
<div class="rec1"></div>
<div class="title">Library</div>
<div class="intro">
lorem ipsum is simply dummy text of the printing and typesetting
industry. loremipsum
</div>
<div class="berief">
lorem ipsum is simply dummy text of the printing and typesetting
industry. loremipsum. Wan xiao peng yi ding hui jin da chang de.Qing
wu bi xiang xin.
</div>
<button class="btn">EXPLORE</button>
</div>
<div class="f21">
<div class="rec2"></div>
<div class="title">Library</div>
<div class="intro">
lorem ipsum is simply dummy text of the printing and typesetting
industry. loremipsum
</div>
<div class="berief">
lorem ipsum is simply dummy text of the printing and typesetting
industry. loremipsum. Wan xiao peng yi ding hui jin da chang de.Qing
wu bi xiang xin.
</div>
<button class="btn">EXPLORE</button>
</div>
<div class="f22"> <img src="/盒模型/浮动/定位/images/b3.jpg" alt=""></div>
<div class="f23">
<div class="rec2"></div>
<div class="title">Library</div>
<div class="intro">
lorem ipsum is simply dummy text of the printing and typesetting
industry. loremipsum
</div>
<div class="berief">
lorem ipsum is simply dummy text of the printing and typesetting
industry. loremipsum. Wan xiao peng yi ding hui jin da chang de.Qing
wu bi xiang xin.
</div>
<button class="btn">EXPLORE</button>
</div>
<div class="f24">
<img src="/盒模型/浮动/定位/images/b4.jpg" alt="">
</div>
</div>
</body>
</html>
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星