Visualizzazione dei risultati da 1 a 3 su 3

Discussione: centrare sfondo body

  1. #1

    centrare sfondo body

    devo centrare una immagine di sfondo (sia orrizontalmente che verticalmente) applicata al tag body:

    http://www.parcomargherita.org/prova/index.html

    utilizzando quel css inline che vedete nel codice della pagina,
    con IE si vede correttamente centrato mentre su FF l' immgine viene centrata solo orrizontalmente,
    come devo correggere?
    tnx

  2. #2

  3. #3
    codice:
    <body style="margin: 0px; padding: 0px; background: transparent url(bg-body2.png) no-repeat 50% 50%";
    1. Manca la chiusura.

    2. Meglio così:

    La tua pagina
    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" xml:lang="it">
    <head>
    <title></title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" href="stile.css" type="text/css" />
    </head>
    <body>
    </body>
    </html>
    Il tuo CSS esterno
    codice:
    body, html{
    	margin: 0;
    	padding: 0;
    	width: 100%;
    	height: 100%;
    	background: url(bg-body2.png) center center no-repeat
    }

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 © 2025 vBulletin Solutions, Inc. All rights reserved.