Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Centrare immagine in una pagina

    Ciao a tutti, scusate la domanda banale, ma come posso centrare verticalmente ed orizzontalmente un'immagine, sempre, in base alla dimensione della finestra del browser?

    Grazie
    Iceberg

  2. #2
    La metti in un div e centri il div
    codice:
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Documento senza titolo</title>
    
    <style type="text/css">
    #immagine {
    	position: absolute;
    	width: 200px;
    	height: 200px;
    	top: 50%;
    	left: 50%;
    	margin: -100px 0 0 -100px;
    }
    </style>
    </head>
    
    <body>
    <div id="immagine">
    	[img]immagine.jpg[/img]
    </div>
    </body>
    <div id="immagine">
    	
    </html>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.