您怎么看,我尝试通过svg取消ul list 。

我尝试使用z-index进行操作,但无法正常工作!

我的html:

    <nav>
 <svg id="bigTriangleColor" style="z-index:-100;fill:rgb(0,0,255);" xmlns="http://www.w3.org/2000/svg" width="100%" height="100" viewBox="0 0 100 100" preserveAspectRatio="none">
    <path d="M0 0 L50 100 L100 0 Z" />
</svg>
  <ul>
   <li><a href="" title="Übersicht">Übersicht</a></li>
   <li><a href="" title="Leute">Leute</a></li>
   <li><a href="" title="Links">Links</a></li>
  </ul>
 </nav>

CSS:
nav {background-color: rgb(14, 131, 205);}


nav{
    border-width:1px 0;
    list-style:none;
    margin:0;
    padding:0;
    text-align:center;
}
nav li{
    display:inline;
}
nav a{
    display:inline-block;
    padding:15px;
    font-size: 17px;
    font-family: 'Open Sans', sans-serif;
    text-decoration:none;

谢谢你的帮助!

最佳答案

我怀疑,您将不得不使用定位。

JSFiddle Demo

nav{
    border-width:1px 0;
    list-style:none;
    margin:0;
    padding:0;
    text-align:center;
    position:relative;
    height:250px; /* or some other number */
}

nav ul {
    position:absolute;
    top:0;
    width:100%;
}

关于html - 在SVG上显示文字,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19349293/

10-12 00:16
查看更多