这是我要制作的div的图像,但我不知道如何制作它
我已经试过了`
.rr > div {
text-align: center;
}
.rr {
position: relative;
height: 200px;
background: #232E39;
}
.rr.rr-left {
z-index: 1;
float: left;
width: 90%;
}
.rr.rr-right {
z-index: 2;
float: right;
width: 10%;
}
.rr:after,
.rr:before {
content: "";
position: absolute;
top: 0;
width: 0;
height: 0;
}
.rr-left:after {
right: 0;
border-left: 100px solid #232E39;
border-bottom: 200px solid #dcdcdc;
}
.rr-right:before {
left: -100px;
border-right: 100px solid #232E39;
border-top: 200px solid transparent;
}
.rr-left > div {
margin-right: 100px;
margin-left: 50px;
}
.rr-right > div {
margin-right: 50px;
margin-left: 25px;
}
<div class="rr rr-right">
<div>
<h4></h4>
</div>
</div>
<div class="rr rr-left">
<div>
</div>
</div>
但是我无法调整这上面的文本和按钮。我在根据图像更改颜色时遇到问题。 `
最佳答案
这会让你开始。 https://jsfiddle.net/4nacnd4b/1/
.rr > div {
text-align: center;
}
.rr {
position: relative;
height: 200px;
background: #232E39;
}
.rr.rr-left {
z-index: 1;
float: left;
width: 90%;
}
.rr.rr-right {
z-index: 2;
float: right;
width: 10%;
background-color: white;
}
.rr:after,
.rr:before {
content: "";
position: absolute;
top: 0;
width: 0;
height: 0;
}
.rr-left:after {
right: 0;
border-left: 100px solid #232E39;
border-bottom: 200px solid #dcdcdc;
}
.rr-right:before {
left: -100px;
border-right: 100px solid white;
border-top: 200px solid transparent;
}
.rr-left > div {
margin-right: 100px;
margin-left: 50px;
}
.rr-right > div {
margin-right: 50px;
margin-left: 25px;
}
关于html - 如何使用html和css制作这个div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35546499/