Suche im Forum:
Suchen


Autor Nachricht
Beitrag19.08.2009 um 17:36 (UTC)    
Titel: CSS: Coolmenü unter den Header positionieren?

Hallo.

Ich habe auf meiner HP eine "Header-Navi" ( oder wie sich dies nennt ^^ ) eingefügt.

Nun das Problem: Die Navi ist über dem Header aber ich will die Unter dem Header haben. Wie mach ich das? =(

Könnte ich die Navi auch in meine Graue Leiste ( die waagerecht über meine HP geht) machen? wenn ja wie?

hier mal mein code:

Zitat:
<style type="text/css" media="screen">
<!--
body
{
font-family: Arial, sans-serif;
font-size: 11px;
overflow: auto;
padding: 13px;
margin: 0px;
}

ul, li
{
list-style-type: none;
padding: 0px;
margin: 0px;
}

div.menu
{
position: absolute;
z-index: 3;
top: 80px;
left: 50%;
margin-left:-290px;
width: 100%;
}

.menu li
{
width: 200px;
float: left;
}

.menu a
{
border: 1px solid #F2F2F2;
background-color:#000C32;
padding-top: 9px;
text-decoration: none;
text-align: center;
font-weight: bold;
cursor: pointer;
margin: 0px 10px;
display: block;
height: 25px;
color: #FFFFFF;
}

.menu a:hover
{
background-color: #000C32;
}

#smenu1, #smenu2, #smenu3
{
font-size: 13px;
display: none;
width: 200px;
float: left;
}

#smenu1 a, #smenu2 a, #smenu3 a
{
font-size: 13px;
font-weight: bold;
padding-top: 9px;
border-top: 0px;
cursor: pointer;
}
//-->

</style>

<script type="text/javascript">
<!--
function montre(id)
{
with (document)
{
if (getElementById)
getElementById(id).style.display = 'block';
else if (all)
all[id].style.display = 'block';
else
layers[id].display = 'block';
}
}

function cache(id)
{
with (document)
{
if (getElementById)
getElementById(id).style.display = 'none';
else if (all)
all[id].style.display = 'none';
else
layers[id].display = 'none';
}
}
//-->
</script>

<div class="menu">
<li><a href="javascript:void(0);" onmouseover="montre('smenu1');" onmouseout="cache('smenu1');">TITEL Navi-Button 1</a>
<ul id="smenu1" onmouseover="montre('smenu1');" onmouseout="cache('smenu1');">
<li><a href="http://HIER SEITE 1.htm" target="_self">Seiten-Name 1</a></li>
<li><a href="http://HIER SEITE 2.htm" target="_self">Seiten-Name 2</a></li>
<li><a href="http://HIER SEITE 3.htm" target="_self">Seiten-Name 3</a></li>
</ul>
</li>

<li><a href="javascript:void(0);" onmouseover="montre('smenu2');" onmouseout="cache('smenu2');">TITEL NAVI-Button 2</a>
<ul id="smenu2" onmouseover="montre('smenu2');" onmouseout="cache('smenu2');">
<li><a href="http://HIER SEITE 1.htm" target="_self">Seiten-Name 1</a></li>
<li><a href="http://HIER SEITE 2.htm" target="_self">Seiten-Name 2</a></li>
<li><a href="http://HIER SEITE 3.htm" target="_self">Seiten-Name 3</a></li>
</ul>
</li>

<li><a href="javascript:void(0);" onmouseover="montre('smenu3');" onmouseout="cache('smenu3');">TITEL NAVI-BUTTON 3</a>
<ul id="smenu3" onmouseover="montre('smenu3');" onmouseout="cache('smenu3');">
<li><a href="http://HIER SEITE 1.htm" target="_self">Seiten-Name 1</a></li>
<li><a href="http://HIER SEITE 2.htm" target="_self">Seiten-Name 2</a></li>
<li><a href="http://HIER SEITE 3.htm" target="_self">Seiten-Name 3</a></li>
</ul>
</li>
</ul>
</div>


Zuletzt bearbeitet von minaforce am 19.08.2009, 18:45, insgesamt einmal bearbeitet
Beitrag19.08.2009 um 17:40 (UTC)    
Titel:

Also du musst nur die Positionierung ändern :
Code:

<style type="text/css" media="screen">
<!--
body
{
font-family: Arial, sans-serif;
font-size: 11px;
overflow: auto;
padding: 13px;
margin: 0px;
}

ul, li
{
list-style-type: none;
padding: 0px;
margin: 0px;
}

div.menu
{
position: absolute;
z-index: 3;
top: 80px; -> Abstand vom oberen Rand, je höher desto weiter unten !
left: 50%;
margin-left:-290px; -> Abstand vom linken Rand, je höher desto weiter links
width: 100%;
}

Code:

.menu li
{
width: 200px;
float: left;
}

.menu a
{
border: 1px solid #F2F2F2;
background-color:#000C32;
padding-top: 9px;
text-decoration: none;
text-align: center;
font-weight: bold;
cursor: pointer;
margin: 0px 10px;
display: block;
height: 25px;
color: #FFFFFF;
}

.menu a:hover
{
background-color: #000C32;
}

#smenu1, #smenu2, #smenu3
{
font-size: 13px;
display: none;
width: 200px;
float: left;
}

#smenu1 a, #smenu2 a, #smenu3 a
{
font-size: 13px;
font-weight: bold;
padding-top: 9px;
border-top: 0px;
cursor: pointer;
}
//-->

</style>

<script type="text/javascript">
<!--
function montre(id)
{
with (document)
{
if (getElementById)
getElementById(id).style.display = 'block';
else if (all)
all[id].style.display = 'block';
else
layers[id].display = 'block';
}
}

function cache(id)
{
with (document)
{
if (getElementById)
getElementById(id).style.display = 'none';
else if (all)
all[id].style.display = 'none';
else
layers[id].display = 'none';
}
}
//-->
</script>

<div class="menu">
<li><a href="javascript:void(0);" onmouseover="montre('smenu1');" onmouseout="cache('smenu1');">TITEL Navi-Button 1</a>
<ul id="smenu1" onmouseover="montre('smenu1');" onmouseout="cache('smenu1');">
<li><a href="http://HIER SEITE 1.htm" target="_self">Seiten-Name 1</a></li>
<li><a href="http://HIER SEITE 2.htm" target="_self">Seiten-Name 2</a></li>
<li><a href="http://HIER SEITE 3.htm" target="_self">Seiten-Name 3</a></li>
</ul>
</li>

<li><a href="javascript:void(0);" onmouseover="montre('smenu2');" onmouseout="cache('smenu2');">TITEL NAVI-Button 2</a>
<ul id="smenu2" onmouseover="montre('smenu2');" onmouseout="cache('smenu2');">
<li><a href="http://HIER SEITE 1.htm" target="_self">Seiten-Name 1</a></li>
<li><a href="http://HIER SEITE 2.htm" target="_self">Seiten-Name 2</a></li>
<li><a href="http://HIER SEITE 3.htm" target="_self">Seiten-Name 3</a></li>
</ul>
</li>

<li><a href="javascript:void(0);" onmouseover="montre('smenu3');" onmouseout="cache('smenu3');">TITEL NAVI-BUTTON 3</a>
<ul id="smenu3" onmouseover="montre('smenu3');" onmouseout="cache('smenu3');">
<li><a href="http://HIER SEITE 1.htm" target="_self">Seiten-Name 1</a></li>
<li><a href="http://HIER SEITE 2.htm" target="_self">Seiten-Name 2</a></li>
<li><a href="http://HIER SEITE 3.htm" target="_self">Seiten-Name 3</a></li>
</ul>
</li>
</ul>
</div>


Ich helfe dir sonst auch per PN
Beitrag19.08.2009 um 17:41 (UTC)    
Titel:

Sowas ist keine allgemeine Frage, sondern css!

Naja, trotzdem.. such im Code folgenden Teil:

Zitat:
div.menu
{
position: absolute;
z-index: 3;
top: 80px;
left: 50%;
margin-left:-290px;
width: 100%;
}

Das blaue kannst du anpassen, je höher die Zahl, desso tiefer geht das Menü!
Beim roten kannst du aussuchen wie weit es nach links/rechts soll, je größer die Zahl, desso weiter geht es dann nach rechts ^^
______________
Spendet jetzt für den User -Name entfernt - , damit er sich ein Duden kaufen kann, da seine Schreibkünste die einens 11-jährigen sehr stark ähneln. Smile


Zuletzt bearbeitet von blutsegelbukaniere am 19.08.2009, 18:43, insgesamt einmal bearbeitet
Beiträge der letzten Zeit anzeigen:   


Powered by phpBB © 2001, 2005 phpBB Group
Deutsche Übersetzung von phpBB.de