html - 如何使用html和css制作这个div?

标签 html css twitter-bootstrap

这是我要制作的div的图像,但我不知道如何制作它

This is the image of div I have to make but I don't know how to make it

我已经试过了`

.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/

相关文章:

javascript - 无法加载资源 : the server responded with a status of 401 for mapbox api

css - 客户端 Bootstrap - 部分 'exceeds' 其限制

javascript - 带有下拉菜单的 Bootstrap Pill 不起作用

html - 托管网页时 CSS 布局失败

html - 如何覆盖 CSS id?

javascript - 我的 angularjs 的一些奇怪的行为

jquery - 在 jquery 中使用 css 的说明

html - 使所有图像大小相同

javascript - 使用 jQuery 在文本变量中查找 div

jquery - 内联 SVG 的 <a> 标记链接在 Safari 中不起作用