Archive | settembre 6, 2010

Div centrato nella pagina. In orizzontale e in verticale

Come disporre un box (div) centrato nella pagina

<html>

<head>
<title></title>
<style type=”text/css”>
<!–
body {
font-family:  Arial;
font-size: 18px;
}

#boxcentrato {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 340px;
height: 240px;
margin: auto;
border: 1px solid #333;
}
–>
</style>

<!–[if IE]>
<style type=”text/css”>
#boxcentrato{
top: 50%;
left: 50%;
margin-left: -170px;
margin-top: -120px;
}
</style>
<![endif]–>

</head>

<body>

<div id=”boxcentrato”>Testo centrato</div>

</body>
</html>

Iscriviti

Get every new post delivered to your Inbox.

Join 29 other followers