Ga naar inhoud

div uitlijnen horizontaal en verticaal in CSS


anoniem

Aanbevolen berichten

ik wil graag een site hebben waar bij de hoogte boven de div 50px is en horizontaal gecentreerd. Het gaat om div "alles" kan iemand zeggen hoe ik dit moet doen? margin: 50px auto; werkt niet. Dit is de html code <div id="alles"> <div id="nav"> </div> <div id="header"> </div> <div id="footer"> </div> <div id="end"> </div> </div> Wat moet nu de CSS code worden om div "alles" horizontaal gecentreerd te krijgen en 50px boven verticaal? Kan iemand mij dat vertellen?
Link naar reactie
Dit staat gewoon in het midden in IE8 [code:1:d22823f357] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="NL" lang="NL"> <head> <title>...............</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Language" content="nl" /> <style type="text/css"> body{ margin:0; padding:0; } #alles{ margin: 50px auto; width:800px; background-color:#ccc; } p{padding:15px;} </style> </head> <body> <div id="alles"> <div id="nav"></div> <div id="header"></div> <p> Lorem ipsum dolor sit Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna Aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat Cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum </p> <div id="footer"></div> <div id="end"></div> </div> </body> </html> [/code:1:d22823f357]
Link naar reactie

Om een reactie te plaatsen, moet je eerst inloggen

Gast
Reageer op dit topic

×   Geplakt als verrijkte tekst.   Herstel opmaak

  Er zijn maximaal 75 emoji toegestaan.

×   Je link werd automatisch ingevoegd.   Tonen als normale link

×   Je vorige inhoud werd hersteld.   Leeg de tekstverwerker

×   Je kunt afbeeldingen niet direct plakken. Upload of voeg afbeeldingen vanaf een URL in

×
×
  • Nieuwe aanmaken...