|
|||
Div im Div zentrieren
Hallo liebe xhtmler,
kann mir jemand helfen? Ich möchte gerne Div im Div zentrieren. Um genau zu sein möchte ich, dass der Inhalt von: themenumrandungzentriert mittig dargestellt wird. Könnt ihr mir bitte helfen? Es funktioniert aber nicht HTML-Code:
.themenumrandung{float:left; width:302px;} .themenumrandungzentriert{margin-top: 0;width:302px;} .themaumrandung{float:left; padding-top:10px; padding-left:6px; padding-right:2px;cursor:pointer;} .themalinks1{ width:8px; height:22px; float:left; background-image:url(../_img/navi-thema1-1.jpg); float:left;} .themarechts1{ width:8px; height:22px; float:left; background-image:url(../_img/navi-thema1-3.jpg); float:left;} .themamitte1{ height:21px; background-image:url(../_img/navi-thema1-2.jpg); float:left; padding-left:3px; padding-right:4px; padding-top:1px;} HTML-Code:
<div class="themenumrandung"><div class="themenumrandungzentriert"> <div onClick="window.location.href='#'" class="themaumrandung"> <div id="1" onMouseOver="swap_bg('1', '2', '3');" onMouseOut="swap_bg_back('1', '2', '3');" class="themalinks1"></div> <div id="2" onMouseOver="swap_bg('1', '2', '3');" onMouseOut="swap_bg_back('1', '2', '3');" class="themamitte1"><a class="thema" href="#">Sex</a></div> <div id="3" onMouseOver="swap_bg('1', '2', '3');" onMouseOut="swap_bg_back('1', '2', '3');" class="themarechts1"></div> </div> <div onClick="window.location.href='#'" class="themaumrandung"> <div id="4" onMouseOver="swap_bg('4', '5', '6');" onMouseOut="swap_bg_back('4', '5', '6');" class="themalinks1"></div> <div id="5" onMouseOver="swap_bg('4', '5', '6');" onMouseOut="swap_bg_back('4', '5', '6');" class="themamitte1"><a class="thema" href="#">Schwangerschaft</a></div> <div id="6" onMouseOver="swap_bg('4', '5', '6');" onMouseOut="swap_bg_back('4', '5', '6');" class="themarechts1"></div> </div> </div></div> |
Sponsored Links |
|
|||
Vielleicht hilft das ja. Ich habe die Seite mal hochgeladen:
http://seismart.de/ Es geht um den den Punkt: "Angesagte Themen" im rechten Menü unten. |
|
|||
Die Inhalte sind nach links gefloatet. Da kann man nichts zentrieren. inline-block wäre ein Ansatz.
Dieses gesamte Konstrukt ist fragwürdig. Wir haben das Jahr 2013 -- da muss man runde Ecken und Hover-Effekte wirklich nicht mehr mit solchen Div-Schachtelkonstrukten und JavaScript erzeugen. Das sollte eine Liste von Links sein (die auch ohne JavaScript nutzbar sind); für runde Ecken und Farbwechsel gibt es CSS (border-radius, :hover).
__________________
Corina Rudel Online-Einsteigerkurs HTML/CSS | Buch: Fortgeschrittene CSS-Techniken |
Themen-Optionen | |
Ansicht | |
|
|
Ähnliche Themen | ||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
Fragen zu CSS und Joomla | DOKTOR | CSS | 2 | 23.05.2011 20:29 |
Brauche Hilfe: Schwarzes Nichts | Zwox | CSS | 10 | 19.11.2010 17:53 |
Header entfernen | tripple | CSS | 17 | 15.06.2010 16:41 |
Schriftfarbe in den Eintragungsfeldern von jforms | Steveislucky | CSS | 2 | 16.03.2010 11:59 |
CSS Text nebeinander? | carstiee09 | CSS | 13 | 13.11.2009 20:18 |