2016-04-18 21 views
-3

Dies ist das erste Mal, eine CSS-Datei von mir selbst zu schreiben.CSS-Code funktioniert nicht richtig

Alles funktioniert gut, aber ich habe ein Problem mit meinem Menü/Inhalt Breite. Ich arbeite mit Prozent, um den gesamten Bildschirm zu füllen. Es gibt noch etwas Platz übrig, und wenn ich meine Browserbreite ändere, ist es total kaputt (Menü/Inhalt).

Code:

header { 
background-color: black; 
color: white; 
text-align: center; 
width: 100%; 
height: 20%; 
margin: 0px; 
padding: 10px; 
} 

menu { 
background-color: gray; 
color: white; 
height: 60%; 
width: 10%; 
float: left; 
margin: 0px; 
padding: 10px; 
} 

content { 
background-color: blue; 
float: left; 
color: white; 
width: 87%; 
height: 60%; 
margin: 0px; 
padding: 10px; 
} 

footer { 
clear: both; 
background-color: black; 
color: white; 
width: 100%; 
height: 20%; 
margin: 0px; 
padding: 10px; 
} 

Dies ist mein Test URL: Testing url

+1

Glaubst du wirklich, dass das der beste Titel ist? Dies ist kein PHP-Forum hier .. – vsync

Antwort

0

Ich denke, das ist, was Sie anstreben.

body { 
    margin:0; 
} 

header { 
    background-color: black; 
    color: white; 
    text-align: center; 
    width: 100%; 
    height: 20%; 
    margin: 0px; 
} 

menu { 
    background-color: gray; 
    color: white; 
    height: 60%; 
    width: 10%; 
    float: left; 
    margin: 0px; 
    -webkit-padding-start: 0px; 
} 

content { 
    background-color: blue; 
    float: left; 
    color: white; 
    width: 90%; 
    height: 60%; 
    margin: 0px; 
} 

footer { 
    clear: both; 
    background-color: black; 
    color: white; 
    width: 100%; 
    height: 20%; 
    margin: 0px; 
}