Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente bannato
    Registrato dal
    Sep 2004
    Messaggi
    13

    Centrare la pagina e usare div assoluti

    Allora, sto cercando di creare una pagina web che dovrebbe ospitare il mio shard di ultima online, solamente che ho un piccolo problema.
    Il mio sito lo visualizza gente che ha una risoluzione 800x600 e altri che ce l'hanno ben più grande.

    Ora ho provato di tutto :dhò: ma niente da fare, in pratica sfasa tutto e solo usando le posizioni normali il tutto funziona.

    Solamente che vorrei un sito centrato invece che tutto spostato su un lato e non vorrei nemmeno estendere il mio sito fino al massimo delle dimensioni.

    Vi vorrei postare qui il codice e il link alla pagine se me lo permettete.

    Link alla pagina

    codice:
    <html>
    <head>
    <title>.:: New Dimension Shard ::.</title>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    //-->
    </script>
    </head>
    <body background="immagini/sfondo.gif">
    <div id="Layer1" style="position:absolute; left:381px; top:195px; width:488px; height:491px; z-index:1">
    <table width="100%">
    <tr>
    <td><font color="#FF0000">Aggiornamento sito - 01/09/2004</font></td>
    </tr>
    <tr>
    <td>
    
    Come potete vedere stiamo riorganizando il sito e devo dire che ne siamo molto fieri della nuova interfaccia. Ovviamente tutto il lavoro non è di una sola persona ma di un team di persona capitanate dal webmaster di Mangaitalia, rocco che ringrazio personalmente per la disponibilit&agrave; dimostrata. Ora il sito &egrave; di nuovo disponibile, ovviamente con il tempo tutte le pagine verranno sistemate e rese disponibili al publico.</p>
      
    
     Lo Staff</p></td>
    </tr>
    </table>
    </div>
    <div id="Layer2" style="position:absolute; left:243px; top:194px; width:113px; height:522px; z-index:2">
      <center>
    
    
    
    Utenti Online: 
        <%
    Sub LogNewUser
                Dim strUserList
                Dim intUserStart, intUserEnd
                Dim strUser
                Dim strDate
    
                strUserList = Application("UserList")
    
            If Instr(1, strUserList, Session.SessionID) > 0 Then
                Application.Lock
                intUserStart = Instr(1, strUserList, Session.SessionID)
                intUserEnd = Instr(intUserStart, strUserList, "|")
                strUser = Mid(strUserList, intUserStart, intUserEnd - intUserStart)
                strUserList = Replace(strUserList, strUser, Session.SessionID & ":" & Now())
                Application("UserList") = strUserList
                Application.UnLock
            Else
                Application.Lock
                Application("ActiveUsers") = CInt(Application("ActiveUsers")) + 1
                Application("UserList") = Application("UserList") & Session.SessionID & ":" & Now() & "|"
                Application.UnLock
            End If
    End Sub
    
    Sub ActiveUserCleanup
    Dim ix
    Dim intUsers
    Dim strUserList
    Dim aActiveUsers
    Dim intActiveUserCleanupTime
    Dim intActiveUserTimeout
    
    intActiveUserCleanupTime = 1 'In minutes, how often should the UserList be cleaned up.
    intActiveUserTimeout = 20 'In minutes, how long before a User is considered Inactive and is deleted from UserList
    
    If Application("UserList") = "" Then Exit Sub
    
    If DateDiff("n", Application("ActiveUsersLastCleanup"), Now()) > intActiveUserCleanupTime Then
    
        Application.Lock
        Application("ActiveUsersLastCleanup") = Now()
        Application.Unlock
    
        intUsers = 0
        strUserList = Application("UserList")
        strUserList = Left(strUserList, Len(strUserList) - 1)
    
        aActiveUsers = Split(strUserList, "|")
    
    For ix = 0 To UBound(aActiveUsers)
        If DateDiff("n", Mid(aActiveUsers(ix), Instr(1, aActiveUsers(ix), ":") + 1, Len(aActiveUsers(ix))), Now()) > intActiveUserTimeout Then
            aActiveUsers(ix) = "XXXX"
        Else
            intUsers = intUsers + 1
        End If 
    Next
    
    strUserList = Join(aActiveUsers, "|") & "|"
    strUserList = Replace(strUserList, "XXXX|", "")
    
        Application.Lock
        Application("UserList") = strUserList
        Application("ActiveUsers") = intUsers
        Application.UnLock
    
    End If
    
    End Sub
    
    
    Call LogNewUser()
    Call ActiveUserCleanup()
    
    Response.Write Application("ActiveUsers")
    
    %>
    </p>
    
    
        
          
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="105" height="23">
            <param name="movie" value="flash/index.swf">
            <param name="quality" value="high">
            <param name="bgcolor" value="#B48A5C">
            <embed src="index.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="23" bgcolor="#B48A5C"></embed>
          </object>
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="105" height="23">
            <param name="movie" value="flash/accounts.swf">
            <param name="quality" value="high">
            <param name="bgcolor" value="#B48A5C">
            <embed src="accounts.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="23" bgcolor="#B48A5C"></embed>
          </object>
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="105" height="23">
            <param name="movie" value="flash/downloads.swf">
            <param name="quality" value="high">
            <param name="bgcolor" value="#B48A5C">
            <embed src="downloads.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="23" bgcolor="#B48A5C"></embed>
          </object>      
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="105" height="23">
            <param name="movie" value="flash/status.swf">
            <param name="quality" value="high">
            <param name="bgcolor" value="#B48A5C">
            <embed src="status.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="23" bgcolor="#B48A5C"></embed>
          </object>
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="105" height="23">
            <param name="movie" value="flash/forum.swf">
            <param name="quality" value="high">
            <param name="bgcolor" value="#B48A4C">
            <embed src="forum.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="23" bgcolor="#B48A4C"></embed>
          </object>
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="105" height="23">
            <param name="movie" value="flash/staff.swf">
            <param name="quality" value="high">
            <param name="bgcolor" value="#B48A4C">
            <embed src="staff.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="23" bgcolor="#B48A4C"></embed>
          </object>
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="105" height="23">
            <param name="movie" value="flash/credits.swf">
            <param name="quality" value="high">
            <param name="bgcolor" value="#B48A4C">
            <embed src="credits.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="23" bgcolor="#B48A4C"></embed>
          </object>
    </p>
    </center>
    </div>
    <div id="Layer3" style="position:absolute; left:891px; top:192px; width:112px; height:522px; z-index:3"></div>
    <div align="center">
    <table width="780px" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td colspan="3">[img]immagini/top_sito.gif[/img]</td>
    </tr>
    <tr>
    <td>[img]immagini/sinistra_up.gif[/img]</td>
    <td>[img]immagini/centro_up.gif[/img]</td>
    <td>[img]immagini/destra_up.gif[/img]</td>
    </tr>
    </table>
    <map name="TOP">
    <area shape="rect" coords="149,138,194,153" href="index.asp">
    <area shape="rect" coords="208,140,278,154" href="accounts.asp">
    <area shape="rect" coords="292,138,376,154" href="downloads.asp">
    <area shape="rect" coords="388,138,443,155" href="http://newdimension.homeip.net:2593/web/status.html" target="_blank">
    <area shape="rect" coords="455,139,503,153" href="http://www.ndshard.net/public/forum/index.php" target="_blank">
    <area shape="rect" coords="519,139,557,151" href="staff.asp">
    <area shape="rect" coords="570,138,629,154" href="credits.asp">
    </map>
    <table width="780px" height="500" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td background="immagini/sinistra_middle.gif" height="14" width="132" border="0"></td>
    <td background="immagini/centro_middle_centrale.gif" height="16" width="516" border="0"></td>
    <td background="immagini/destra_middle.gif" height="14" width="132" border="0"></td>
    </tr>
    </table>
    <table width="780px" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td background="immagini/sinistra_middle.gif" height="14" border="0"></td>
    <td>[img]immagini/centro_down.gif[/img]</td>
    <td background="immagini/destra_middle.gif" height="14" border="0"></td>
    </tr>
    <tr>
    <td>[img]immagini/sinistra_down.gif[/img]</td>
    <td>[img]immagini/centro_down_scritta.gif[/img]</td>
    <td>[img]immagini/destra_down.gif[/img]</td>
    </tr>
    </table>
    </div>
    </body>
    </html>
    Potreste gentilmente darmi una mano o almeno qualche indicazione per risolvere il mio problema ? Grazie !

  2. #2
    Utente bannato
    Registrato dal
    Sep 2004
    Messaggi
    13
    Nessuno ha voglia di darmi una mano ?

  3. #3
    ma che è uno shard? e poi perché ti metti a frignare? lo sanno i tuoi compagni di gioco di questi cedimenti?

    centrare non è un problema, semmai il problema potrebbe essere ricorrere ai layer quando non è necessario come stai facendo tu, però se sei orientato così...


    stai usando uno script per centrare? non ce n'è bisogno, guardando il tuo codice da lontano dovrebbe bastarti usare un div con position:relative centrare questo e infilare i layer dentro esso tipo:

    <html>
    <head>
    <title>Document's title</title>
    <style type="text/css">
    body {text-align:center}

    .centrX2 {position:relative;
    margin:auto;
    width:500px;
    background:red;
    height:400px;
    text-align:left;
    }
    .assoluto {
    position:absolute;
    top:150px;
    left:10px;
    background:fuchsia
    }
    </style>
    </head>
    <body>
    <div class="centrX2">centrato
    <div class="assoluto">assoluto dentro il relative</div>
    </div>
    </html>
    4 pag. x il forum:l'ospite ora ha solo link sponsorizzati, valli a capire-GommaLayout! Agg. 25 agosto 2004)-Molla&Collano privati tecnici, per favore

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.