Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display text over svg

Tags:

html

css

svg

How you can see i try to dispay an ul list over an svg.

enter image description here

I tried something with z-index but it wont work!

My 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>

The 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;

Thanks for your help!

like image 714
John Smith Avatar asked Oct 13 '13 19:10

John Smith


1 Answers

You would have to use positioning, I suspect.

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%;
}
like image 88
Paulie_D Avatar answered Oct 15 '22 14:10

Paulie_D