• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Navigationsleiste horizontal zentrieren

bubuloe

Neues Mitglied
Huhu :o)

ich weiß es gibt schon 100.000.000.000.... Einträge über das Thema "Navigationsleiste horizontal zentrieren".. aber ich suche schon seit ein paar Tagen nach der Lösung aber irgendwie will sich dieses doofe Ding einfach nicht HORIZONTAL ZENTRIEREN :twisted: grml

mein css
Code:
 body { text-align:center; background:#a8cff0; font-size:90%;
 font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; margin:0; padding:0; }


#navcontainer { position:absolute; height: 30px;
          width:37em; margin:0 auto; }


  #navicontainer ul ul { position: absolute; left:50%; }

    #navcontainer ul ul ul { position: absolute; top: 0; left: 100%;  }

    #navcontainer ul ul,
    #navcontainer ul li:hover ul ul,
    #navcontainer ul ul li:hover ul ul
      {display: none; }

    #navcontainer ul li:hover ul,
    #navcontainer ul ul li:hover ul,
    #navcontainer ul ul ul li:hover ul
      {display: block;  }
mein html
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>pups</title>
<meta name="author" content="pups">
     <link rel="stylesheet" type="text/css" href="style.css">

</head>
<body text="#000000" bgcolor="white" link="#FF0000" alink="#FF0000" vlink="#FF0000"
text-align:center>

  <div align="center">
  <img src="banner.png" width="60%" alt="banner" >
</div>


<div id="navcontainer">

<ul>
  <li><a href="index.html">Home</a></li>


    <li><a href="#">Bilder</a>
      <ul>

      <li><a href="#">seite 1</a>
        <ul>
        <li><a href="#">2010</a></li>
        <li><a href="#">2011</a></li>
        </ul>
      </li>
      </ul>
    </li>


</ul>

</div>


 <br>
 <br>
 <br>

 <table border="0" cellpadding="0" align="left" width=20%>
<tr height=1024px>        <th>&nbsp;</th> </tr>
</table>

<table border="0" cellpadding="0" align="right" width=20%>
<tr height=1024px>        <th>&nbsp;</th> </tr>
</table>

<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
 aliquyam erat, sed diam voluptua. At vero eos et accusam et justo
  duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
   sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
    consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
    ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero
    eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
    no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>

</body>
</html>
vielleicht findet jemand eine Lösung ... ;JumpDas wär soooo toll & schonmal vielvielmals danke
 
Eine horizontal zentrierte Navigation ist nur möglich, wenn du für sie eine feste Breite, welche die Navigationspunkte genau einnehmen, definierst.

Also gib den Navigationpunkten und anschließend der Navigation selbst feste Breiten und zentriere mit:
Code:
margin: 0 auto;

Eine andere Möglichkeit kenne/sehe ich nicht.
 
Zurück
Oben