|
|||
Navigations Problem <ul>Tag
Hallo zusammen,
die FAQ hat zwar schon tolle Dienste geleistet aber leider habe ich immernoch ein kleines Problem mit einer Navigation die auf dem Listentag basiert. Die Website kommt später noch einen Header und Footer. Ist momentan aber wie folgt aufgebaut: Div-Layer mit <ul><li> Navigation (horizontal) Div-Layer mit 3 weiteren Layern um Spalten zu simulieren. Mein Problem ist, dass die Navigation nicht linkbündig steht sondern um ca. 20px nach Rechts rückt. Vllt. überseh ich einfach nur etwas aber ich finde den Fehler nicht. – hoffe ihr könnt mir helfen. Grüße Blaze HTML-Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head></head> <body> <div id="menu"><ul id="nav"> <li id="home" class="activelink"><a href="index.php">Home</a></li> <li id="komp"><a href="kompetenzen.php">Kompetenzen</a></li> <li id="kon"><a href="kontakte.php">Kontakte</a></li> <li id="down"><a href="downloads.php">Downloads</a></li> <li id="ref"><a href="referenzen.php">Referenzen</a></li> <li id="anf"><a href="anfahrt.php">Anfahrt</a></li> <li id="impr"><a href="impressum.php">Impressum</a></li> </ul></div> <div id="content" class="clearfix"> <div id="sp_1"> <span class="head">Headline</span><hr color="#cccccc">Text.</div> <div id="sp_2" style=""> <span class="head">Headline</span><hr color="#cccccc">Text.</div> <div id="sp_3"> <span class="head">Headline</span><hr color="#cccccc">Text.</div> </div> </html> </body> HTML-Code:
html,body { background-color:#D0D4D4; font-family:Arial, Helvetica, sans-serif; font-size:11px; line-height:18px; } /*BANNER PROPERTIES*/ #header { width:970px; height:250px; background-color:#FFFFFF; padding:5 5 0 5; background: url(images/header.jpg) top center no-repeat; } /*TOP NAVIGATION*/ div#menu { width: 970px; background-color:#FFFFFF; } ul#nav { list-style-type:none; margin: 0px 0px 0px 0px; height:24px; } ul#nav li { background-color: #ffffff; text-align: center; } ul#nav a { float: left; width: 128px; margin: 0px 2px 0px 2px; padding: 5px 0px 5px 0px; background: #D0D4D4; text-decoration: none; color: #666666; } ul#nav a:hover { background: #B2B6B6; color: #ffffff; } ul#nav li.activelink a,ul#nav li.activelink a:hover { background: #B2B6B6; color: #ffffff; } /*MAIN CONTAINER*/ #container { width: 970px; } #content { width: 930px; padding: 40px 20px 20px 20px; background-color: #ffffff; margin:0px 0px 10px 0px; } #sp_1 { width: 285px; float:left; margin-right: 30px; margin-bottom: 20px; } #sp_2 { width: 285px; float:left; margin-right: 30px; margin-bottom: 20px; } #sp_3 { width: 285px; float:left; margin-bottom: 20px; } .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } /* Hides from IE-mac \*/ * html .clearfix {height: 1%;} /* End hide from IE-mac */ |
Sponsored Links |
|
||||
Das Problem ist das Standart Padding des Browsers. Schreib doch mal in die menü ul Regel "padding: 0" oder ähnliches
Hier jetzt der Hinweis auf den CSS Prolog: http://xhtmlforum.de/40267-faq-h-ufi...ragen-und.html
__________________
Hier ein immer gültiges Statement: Überarbeite deine Code, lerne die Grundlagen, widersprich mir nicht, wehre dich nicht, ich habe Recht, wir sind Lolgion, wir sind viele.. potato... All meine Angaben sind ohne Gewähr, es könnte also trotz meiner Unfehlbarkeit dazu kommen dass ich falsch liege www.richard-thiel.de | Müssen Websiten überall gleich ausschauen? |
Sponsored Links |
|
|||
Float für die li-Elemente hilft.
__________________
Corina Rudel Online-Einsteigerkurs HTML/CSS | Buch: Fortgeschrittene CSS-Techniken |
Themen-Optionen | |
Ansicht | |
|
|
Ähnliche Themen | ||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
Design zu CSS/HTML verarbeiten - Problem häufen sich. | Grafikamateur | CSS | 2 | 06.08.2007 10:57 |
Navigations Problem mit IE und Safari | Solander | CSS | 2 | 27.02.2007 14:39 |
Problem mit WordPress und dem Bilder Upload | Maxefix | Serveradministration und serverseitige Scripte | 0 | 19.12.2006 15:58 |
Problem bei Div's - zwei mal das gleiche und doch nicht ... | Niriel | CSS | 10 | 09.06.2005 18:39 |
Problem mit einem CSS Layout | nARC | CSS | 20 | 21.05.2005 07:28 |