000
13.02.2009, 11:44
luckerking
|
Hey,
ich habe zur Zeit einen merkwürdigen Fehler, den ich mir einfach nicht erklären kann. Vorweg muss ich sagen, dass ich noch nicht viel Erfahrung mit XHTML und CSS habe. Laut den wc3 Valdidatoren sind CSS und XHTML valide, trotzdem benutzt er nur dass halbe CSS. D.h. Links sind farbig, aber die Positionen der Div-Blöcke stimmen nicht. Lässt man den XHTML DocType weg oder ersetzt ihn, wird alles richtig dargestellt. Ich habe offenbar etwas übersehen, aber was?
XHTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"> <head> <title>test</title> <link rel="stylesheet" type="text/css" href="format.css"></link> </head> <body> <div id="pageElements"> <div id="Left"> <div class="m4_page_menu_tree"> <ul> <li><a href="index.php?pid=3"><span>home</span></a></li> <li><a href="index.php?pid=4"><span>Page Editor</span></a></li> <li><a href="index.php?pid=5"><span>Data Editor</span></a></li> <li><a href="index.php?pid=6"><span>Module Admin</span></a></li> <li><a href="index.php?pid=7"><span>User Admin</span></a></li> </ul> </div> <div class="sys_login_status"> <a href="index.php?pid=3"><span>Logout(admin)</span></a></div> </div> <div id="Middle"> <div class="m4_content_elements_text"> <span>Startseite</span> </div> </div> </div> </body> </html>
CSS:
body { font-family : Verdana ; font-size : 12px} a {color:blue; text-decoration: none} a:visited {} ul { list-style-type:none;} #pageElements { position:absolute; top: 0; right: 0px; bottom :0px; left: 0px; } #left { border-right: 1px solid #666666; float:left; margin: 0px; padding:0px; text-align:left; width:150px; height :100%; background-color: #eae6e6; } #middle { margin-left : 150px; padding : 20px; }
div.m4_page_menu_tree { margin-top : 40px; height :90%; } div.m4_page_menu_tree span { color: #333131; padding: 3px 0px 3px 30px; display:block; text-align: left; font-weight:bold; } div.m4_page_menu_tree a:hover span { background-color: #dedcdc; border-top: 1px solid #666666; border-bottom: 1px solid #666666; padding: 2px 0px 2px 30px; } div.m4_page_menu_tree ul { margin : 0px; padding : 0px; } div.sys_login_status span{ display:block; text-align: center; }
(Ihr könnt auch ruhig Anmerkungen zur Verbesserung der CSS Datei machen)
--
Dieser Beitrag wurde am 13.02.2009 um 11:45 von luckerking bearbeitet.
|
|
Profil || Suche
|
001
13.02.2009, 12:23
Adrian_Broher
Admin
|
Reduzier deine Div Suppe. Der Großteil der divs und spans ist überflüssig.
Und ids sind case sensitive, d.h. Left != left und Middle != middle
--
There is nothing wrong with high standards. It's your problem that you don't meet them. If you think it's simple, then you have misunderstood the problem. When a customer says "nothing has changed", assume they're lying.
Dieser Beitrag wurde am 13.02.2009 um 12:49 von Adrian_Broher bearbeitet.
|
|
Profil || Suche
|
002
13.02.2009, 12:30
luckerking
|
Adrian_Broher postete Und ids sind case sensitive, d.h. Left != left und Middle != middle
Vielen Dank!
--
|
|
Profil || Suche
|