当前位置:  开发笔记 > 前端 > 正文

矩形下的CSS三角形

如何解决《矩形下的CSS三角形》经验,为你挑选了1个好方法。

在此输入图像描述

这就是我想要的.目前我只有一个里面有文字的矩形.不知道如何在它下面创建这个矩形.

码:

.txt_First {
    font-size:0.8em;
    text-align: justify;
    padding-bottom:20px;
}
.com_box {
    width:60px;
    height: 50px;
    background: black;
    color:white;
    float:left;
    display: flex;
    justify-content: center; /* align horizontal */
    align-items: center; /* align vertical */
    margin-right:8px;
    margin-bottom: 5px;
    margin-top:1px;
}

HTML:

71
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

这是jsfiddle:http://jsfiddle.net/wrm4y8k6/



1> LGSon..:

这对你有用吗?

.txt_First {
        font-size:0.8em;
        text-align: justify;
        padding-bottom:20px;
    }
    .com_box {
        width:60px;
        height: 50px;
        background: black;
        color:white;
        float:left;
        display: flex;
        justify-content: center; /* align horizontal */
        align-items: center; /* align vertical */
        margin-right:8px;
        margin-bottom: 5px;
        margin-top:1px;
        position: relative;
    }
.com_box:after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 10px 0 0;
  border-color: #000 transparent transparent transparent;
}
71
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
推荐阅读
小白也坚强_177
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有