|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Feb 2004
Città: Lecco/Milano
Messaggi: 2863
|
[xhtml] div centrato verticalmente
come faccio a far si che anche se cambio la risoluzione il mio div stia sempre alineato verticalmente? cioè che non si sposti in su o in giù a causa del cambio di risoluzione
__________________
C'era un moscerino sul tuo schermo |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Feb 2004
Città: Lecco/Milano
Messaggi: 2863
|
risolto
__________________
C'era un moscerino sul tuo schermo |
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Jun 2002
Città: Firenze
Messaggi: 630
|
Lo avevo postato recentemente in un altro thread, non c'è solo quello che ti serve, ma puoi facilmente estrarlo.
Codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><style>
#centrato {
position: absolute;
left: 0px; top: 50%;
height: 1px; width: 100%;
overflow: visible;
}
#contenuto {
position: absolute;
margin-left: -50px;
top: -25px; left: 50%;
width: 100px; height: 50px;
background-color: #ffeeee;
}
</style></head>
<body>
<div id="centrato"><div id="contenuto">SONO AL CENTRO</div></div>
Content content content content content content content content content<br /><br /><br />
Content content content content content content content content content<br /><br /><br />
Content content content content content content content content content<br /><br /><br />
Content content content content content content content content content<br /><br /><br />
Content content content content content content content content content<br /><br /><br />
Content content content content content content content content content<br /><br /><br />
Content content content content content content content content content<br /><br /><br />
</body>
</html>
__________________
---> Lombardp CSS Certified Expert (Master Level) at Experts-Exchange Proud user of LITHIUM forum : CPU technology Webmaster of SEVEN-SEGMENTS : Elettronica per modellismo |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 22:26.



















