css实现三角形图形


<style>

    div{

        margin-top: 10px;
        float: left;
        text-align: center;
    }

/*--css--*/
.box_left{


    position: relative;
    padding: 0 20px;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #efefef;
    font-size: 18px;
    line-height: 80px;
    margin-left: 50px;
}

.box_left:after{
    position: absolute;
    top: 50%;
    left: -15px;
    z-index: 1;
    display: block;
    margin-top: -15px;
    width: 0;
    border-color: transparent  #efefef transparent #efefef ;
    border-style: solid;
    border-width:  15px 15px  15px 0;
    content: "";
}

.box_right{


    position: relative;
    padding: 0 20px;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #efefef;
    font-size: 18px;
    line-height: 80px;
    margin-left: 50px;


}

.box_right:after{
    position: absolute;
    top: 50%;
    right: -15px;
    z-index: 1;
    display: block;
    margin-top: -15px;
    width: 0;
    border-color: transparent  #efefef transparent #efefef ;
    border-style: solid;
    border-width:  15px 0  15px 15px;
    content: "";
}



    .box_up{


        position: relative;
        padding: 0 20px;
        width: 80px;
        height: 80px;
        border-radius: 8px;
        background: #efefef;
        font-size: 18px;
        line-height: 80px;
        margin-left: 50px;


    }

    .box_up:after{
        position: absolute;
        top: -15px;
        left: 50%;
        z-index: 1;
        display: block;
        margin-left: -15px;
        height: 0;
        border-color: #efefef transparent #efefef transparent;
        border-style: solid;
        border-width: 0 15px 15px 15px;
        content: "";
    }

    .box_down{


        position: relative;
        padding: 0 20px;
        width: 80px;
        height: 80px;
        border-radius: 8px;
        background: #efefef;
        font-size: 18px;
        line-height: 80px;
        margin-left: 50px;


    }

    .box_down:after{
        position: absolute;
        bottom: -15px;
        left: 50%;
        z-index: 1;
        display: block;
        margin-left: -15px;
        width: 0;
        border-color: #efefef transparent #efefef transparent;
        border-style: solid;
        border-width: 15px 15px 0 15px;
        content: "";
    }
</style>


<body>

<div class="box_left">Left</div>
<div class="box_right">Right</div>
<div class="box_up">Up</div>
<div class="box_down">Down</div>

</body>
</html>

上一篇: UEditor asp版本无法上传图片的bug解决办法
下一篇: HTML实体符号代码速查表
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
发表评论
昵 称:
密 码: 游客发言不需要密码.
邮 箱: 邮件地址支持Gravatar头像,邮箱地址不会公开.
网 址: 输入网址便于回访.
内 容:
验证码:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 关闭 | [img]标签 关闭