谁能告诉我在CSS中如何使三角形像我想要的那样居中或居中?
编辑:
与一个元素。

最佳答案

@harry;有很多方法可以创建这种类型的三角形箭头。我编辑@jam fiddle,将箭头居中。

CSS:

div
{
    background: #76a7dc;
    padding: 10px;
    display: inline;
    position:relative;
}

div:after
{
    border-color: #76a7dc transparent;
    border-style: solid;
    border-width: 10px 10px 0;
    content: "";
    margin-top: 5px;
    display: block;
    position: absolute;
    width: 0;
    margin-left:-10px;
    left:50%;
    bottom:-9px;
}


检查此示例http://jsfiddle.net/sandeep/wWykY/2/

关于css - CSS3菜单的形状,样式,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7330027/

10-11 00:59
查看更多