Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 20

Discussione: centrare un layer

  1. #1

    centrare un layer

    scusate....

    vorrei capire come centrare un layer nella pagina (questo layer ha dimensioni ben precise perchè contiene un'immagine di sfondo che serve per lo sviluppo del sito) mi dite come fare?

    ho letto di mettere :

    margin-top: auto;
    margin-left: auto;

    e per explorer :

    text-align: center;

    ma non funziona perchè?
    Daemons Brugherio American Football Team
    Luca Chirico A.K.A. KIRIKONG or 2K
    LB#2

  2. #2
    AtomSurfer
    Guest
    per ie, lo devi mettere nel body
    per gli altri usa, ad es, "margin: 10px auto;" e poi, se necessario, specifica gli altri a parte



  3. #3
    scusa non ho ben capito io ho questo css:

    body {
    background-color: #8EC7FF;
    cursor: default;
    text-align: center;
    }

    e poi

    #sfondo {
    background-image: url(../immagini/sfondo.png);
    background-position: center center;
    height: 510px;
    width: 750px;
    background-repeat: no-repeat;
    position: absolute;
    z-index: 1;
    margin-top: auto;
    margin-left: auto;
    }

    perchè non me lo centra?
    Daemons Brugherio American Football Team
    Luca Chirico A.K.A. KIRIKONG or 2K
    LB#2

  4. #4
    AtomSurfer
    Guest
    così dovrebbe andare:
    codice:
    body {
    	background-color: #8EC7FF;
    	cursor: default;
    	text-align: center;
    }
    
    #sfondo {
    	background-image: url(../immagini/sfondo.png);
    	background-position: center center;
    	height: 510px;
    	width: 750px;
    	background-repeat: no-repeat;
    	position: absolute;
    	z-index: 1;
    	margin: 0 auto;
    }

  5. #5
    AtomSurfer
    Guest
    ah, scusa... mi è sfuggito un particolare... devi togliere position: absolute

  6. #6
    non funziona........
    Daemons Brugherio American Football Team
    Luca Chirico A.K.A. KIRIKONG or 2K
    LB#2

  7. #7
    non avevo letto.....

    ok va grazie e a buon rendere
    Daemons Brugherio American Football Team
    Luca Chirico A.K.A. KIRIKONG or 2K
    LB#2

  8. #8
    un problemino ancora però.....

    mi centra il layer in oriz. ma per farlo centrare in verticale?????

    così non va....

    body {
    text-align: center;
    background-color: #CAE4FF;
    filter: alpha(opacity=75);
    -moz-opacity: 0.75 ;
    cursor: default;
    }

    #sfondo {
    background-image: url(../immagini/sfondo.jpg);
    background-position: center center;
    height: 510px;
    width: 750px;
    background-repeat: no-repeat;
    z-index: 1;
    margin: auto;
    text-align: left;
    }
    Daemons Brugherio American Football Team
    Luca Chirico A.K.A. KIRIKONG or 2K
    LB#2

  9. #9
    up
    Daemons Brugherio American Football Team
    Luca Chirico A.K.A. KIRIKONG or 2K
    LB#2

  10. #10

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.