Visualizzazione dei risultati da 1 a 3 su 3

Discussione: body background

  1. #1
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929

    body background

    ciao a tutti,

    ho una pagina molto semplice con solo un'immagine di sfondo e vorrei fosse centrata ho fatto cosi
    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>sito</title>
    <style type="text/css">
    <!--
    body {
    	background-color: #000;
    	background-image: url(img/foto.jpg);
    	background-repeat: no-repeat;
    	background-position: center center;
    
    }
    -->
    </style></head>
    
    <body>
    </body>
    </html>
    solo che non capisco perchè l'immagine si vede tutta in alto e per metà!



    Grazie mille

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    fatto

    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>miosito</title>
    <style type="text/css">
    html, body {
    		background-color: #000;
    		height: 100%;
    		margin: 0;
    		padding: 0;
    }
    </style>
    </head>
    <body>
    <table width="100%" height="100%" border="0">
    <tr>
    <td valign="middle"><div align="center">[img]img/foto.jpg[/img]</div></td>
    </tr>
    </table>
    </div>
    </body>
    
    </html>

  3. #3
    Amministratore L'avatar di Vincent.Zeno
    Registrato dal
    May 2003
    residenza
    Emilia-Romagna (tortellini und cappelletti land!)
    Messaggi
    20,812
    guarda cha la tua sintassi originale era corretta

    a parte gli errori...
    mettere una tabella per avere un background è una follia

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.