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

    Centrare elementi in una pagina

    Ciao a tutti,

    ho fatto questa pagina html con css.

    L'unica parte che non viene allineata in risoluzione 1024*768 è il div <div id=testo>,
    sia con IE che con Firefox.
    Se l'allineo per IE non mi si visualizza bene con Firefox e viceversa.

    Non riesco a capire perchè tutti gli altri elementi della pagina li vedo centrati bene a qualsiasi risoluzione sia con IE che con Firefox e il testo no.

    Sapete come posso risolvere questo problema ?

    grazie anticipatamente

    vito
    ************************************************** **************

    <html>

    <head>
    <meta http-equiv="Content-Language" content="it">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Prova</title>

    <style type="text/css" media="screen">

    body{
    position:relative;
    margin:auto;
    padding:0;
    font-family: "Trebuchet MS", Georgia, Verdana, sans-serif;
    text-align:center;

    }

    #logo{
    width:900px;
    height:200px;
    line-height: 200px;
    margin: 0px auto;
    padding:0;

    }

    #bottoni{
    width:880px;
    height:200px;
    line-height: 100px;
    margin: -79px auto;
    padding:0;

    }

    #verticali{
    width:900px;
    height:165px;
    line-height: 200px;
    margin: -160px auto;
    padding:0;
    text-align:left;
    }

    #testo{
    position:absolute;
    width:650px;
    top: 320px;
    left: 405px;
    margin: -150px auto;
    text-align:justify;
    font : bold 12px Verdana, Geneva, Arial, Helvetica, sans-serif;
    }



    </style>



    </head>

    <body bgcolor="#FFFFFF">

    <div id="logo">
    [img]images/Logo.gif[/img]
    </div>

    <div id="bottoni">
    <script language="javascript" src="bottoni.js"></script>
    </div>

    <div id="verticali">
    <script language="javascript" src="vertical.js"></script>
    </div>



    <div id=testo>
    <p style="line-height: 125%; margin-top: 2px; margin-bottom: 2px">
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto
    testotestotestotesto testotestotestotesto testotestotestotesto

    </p>
    </div>




    </body>

    </html>

  2. #2
    è semplice hai messo la posizione su un valore assoluto

    codice:
    #testo{
    position:absolute;
    width:650px;
    top: 320px;
    left: 405px;
    margin: -150px auto;
    text-align:justify;
    font : bold 12px Verdana, Geneva, Arial, Helvetica, sans-serif;
    }
    le vedi le righe in grassetto? Toglile e vedrai il testo centrato, almeno io lo vedo centrato dopo averle tolte (ho usato sia ff che ie).

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.