zurück zur Startseite
  


Zurück XHTMLforum > (X)HTML und CSS > CSS
Seite neu laden Horizontale Navigationsleiste an ganzes Fenster anpassen

Antwort
 
LinkBack Themen-Optionen Ansicht
  #1 (permalink)  
Alt 23.05.2012, 22:44
Neuer Benutzer
neuer user
Thread-Ersteller
 
Registriert seit: 19.05.2012
Ort: Wattwil
Beiträge: 3
ILaRy befindet sich auf einem aufstrebenden Ast
Frage Horizontale Navigationsleiste an ganzes Fenster anpassen

Guten Abend

Ich möchte eine Horizontale Navigationsleiste an die ganze breite des Fensters anpassen. (variiert ja je nach Benutzer)

CSS

body {
font: normal 100.00% Helvetica, Arial, sans-serif;
color: black;
margin: 0xp;
padding: 0px;
width: 100%;
}

ul#Navigation {
margin: 0px;
padding: 0px;
text-align: center;
background-color: silver;
alignment-adjust:central;
}
ul#Navigation li {
list-style: none;
display: inline;
margin: 0px;
padding: 0px;
}


ul#Navigation a, ul#Navigation span {
float: left;
width: 14%;
margin: 0px;
padding: 0px;
text-decoration: none;
font-weight: bold;
color: black;
background-color: #ccc;

}

ul#Navigation a:hover, ul#Navigation span {
color: white;
background-color: gray;
}
ul#Navigation div {
clear: right;
}

Doch wie es so ist, hat es immer am rechten Rand einen etwa 1 cm grossen Abstand. Also je nach Fenstergrösse.

Wie kann ich die gesamte Breite auf 100% setzen.

Gruss und im voraus schon vielen Dank
Ilario
Mit Zitat antworten
Sponsored Links
  #2 (permalink)  
Alt 23.05.2012, 23:35
Benutzerbild von siluan.tahir
Neuer Benutzer
neuer user
 
Registriert seit: 18.05.2012
Beiträge: 12
siluan.tahir befindet sich auf einem aufstrebenden Ast
Standard

Ich denk mal das der Fehler daran liegt das du body nicht mittels CSS margin: 0 vergeben hast.
Stichwort: Reset CSS.
Zusätzlich solltest du einen doctype in deiner HTML Datei verwenden.
Z.B. die HTML5 Variante <!DOCTYPE html>

So würde es dann im Quellcode ausschauen:
Code:
<!DOCTYPE html>
<html lang="de">
  <head>
    <meta charset="utf-8" />
    <title>HTML5 Layout</title>
    <link rel="stylesheet" href="css/main.css" type="text/css" />
  </head>
  <body>
  ...
  </body>
</html>
__________________
Webdesigner Düsseldorf
Mit Zitat antworten
Sponsored Links
  #3 (permalink)  
Alt 24.05.2012, 16:48
Neuer Benutzer
neuer user
Thread-Ersteller
 
Registriert seit: 19.05.2012
Ort: Wattwil
Beiträge: 3
ILaRy befindet sich auf einem aufstrebenden Ast
Beitrag

Danke für die Antwort.

Aber dies ist nur CSS das ganze HTML habe ich schon richtig gemacht.
Der Body hat margin/padding 0px.
Mit Zitat antworten
  #4 (permalink)  
Alt 24.05.2012, 20:01
Erfahrener Benutzer
XHTMLforum-Mitglied
 
Registriert seit: 02.01.2012
Beiträge: 487
dazzle89 wird schon bald berühmt werden
Standard

Gib ul#Navigation ein overflow: hidden;
Mit Zitat antworten
  #5 (permalink)  
Alt 24.05.2012, 22:36
Benutzerbild von lottikarotti
Ein ♥ für's Web
XHTMLforum-Mitglied
 
Registriert seit: 18.04.2012
Ort: Karlsruhe
Beiträge: 396
lottikarotti wird schon bald berühmt werden
Standard

Hallo,

der Wert 0 benötigt keine Einheit. Zudem hat das von dir gepostete CSS einen Tippfehler, denn dort steht margin: 0xp;.
Es wäre definitiv von Vorteil, wenn du uns das dazugehörige HTML zur Verfügung stellst und evt. sogar eine Online-Version, welche das Problem zeigt.

Gruß, lotti.
__________________
Empfehlenswerte Links:
jsFiddle | JavaScript Patterns | RedBeanPHP | Mozilla Developer Network -/- W3C Validator | JSLint
Mit Zitat antworten
Antwort

Stichwörter
css, horizontal, navigationsleise

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
horizontale Navigationsleiste Kaykay (X)HTML 3 04.11.2010 08:41
horizontale Navigationsleiste Tobe CSS 0 20.07.2008 10:34
Horizontale Navigationsleiste Marco D. CSS 10 19.08.2007 10:55
Mitwachsende horizontale Navigationsleiste und Schriftarten boxi CSS 1 17.04.2006 17:24
mit <li> horizontale navigationsleiste oimelchen CSS 17 26.10.2005 19:29


Alle Zeitangaben in WEZ +2. Es ist jetzt 23:28 Uhr.