html - 如何制作带填充的插图边框

标签 html css border insets

我有这个 JsFiddle:Click here

       <div id='menu'>
            <ul>
                <li><a class='styleanchor' href="${pageContext.request.contextPath}/mainpage/">
                    hone</a></li><!--  
                --><li><a class='styleanchor' href="${pageContext.request.contextPath}/verification/user/">asdsad</a></li><!--  
                --><li><a class='styleanchor' href="${pageContext.request.contextPath}/verification/user/">Replace this LOL</a></li><!--  
                --><li><a class='styleanchor' href=index.html>Replace this LOL</a></li><!--  
                --><li><a class='styleanchor' href=index.html>Replace this LOL</a></li><!--  
                --><li><a class='styleanchor' href="${pageContext.request.contextPath}/verification/store/"></a></li> 
            </ul>   
        </div>

我想让我的边框更像图像中的边框:

enter image description here

如您所见,它有一个内嵌边框,我猜它的顶部和底部都有填充。

我怎样才能实现那些使用css的?我尝试向 li 添加填充,但没有成功。

最佳答案

如果我理解这里的问题是DEMO

a.styleanchor:hover:before
    {
        content: "";
       position: absolute;
    display: inline-block;
    width: 0;
    height: 0;
    line-height: 0;
    border: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
    left: 43%;
    right:43%;
    bottom: 0;
    }
#menu {
        text-align: center;
        position: relative;
        border-bottom: 1px solid gray;
        border-top: 1px solid gray;
        background: #ffffff; /* Old browsers */
        background: -moz-linear-gradient(top,  #ffffff 0%, #e5e5e5 100%); /* FF3.6+ */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
        background: -webkit-linear-gradient(top,  #ffffff 0%,#e5e5e5 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top,  #ffffff 0%,#e5e5e5 100%); /* Opera 11.10+ */
        background: -ms-linear-gradient(top,  #ffffff 0%,#e5e5e5 100%); /* IE10+ */
        background: linear-gradient(to bottom,  #ffffff 0%,#e5e5e5 100%); /* W3C */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */
        border-radius: 10px 10px 0px 0px;

    }

关于html - 如何制作带填充的插图边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26115884/

相关文章:

html - 即使列数为 12, Bootstrap 中的列也不适合

html - IE float 无填充错误

css - 过滤器 : progid:DXImageTransform. Microsoft.gradient 在 ie7 中不工作

html - 如何在 CSS 中创建点划线和点划线点线和矩形

html - 父 div 的边框不绑定(bind)到子元素的大小

html - 当我在 IE 的 iframe 中有 iframe 时无法删除边框

javascript - 在 ng-click 上更新 AngularJS 模型,DOM 没有响应

php - Joomla 3 隐藏特定页面的内容

javascript - 溢出 HTML 框架元素之外的内容

html - 减少链接的边框