2010-08-13 6 views
0

아래의 페이지 번호 코드는 정상적으로 작동합니다. 그러나 CSS에 문제가 있습니다. 페이지 매김 링크의 위치는 실제로 사용자가 1 페이지에있을 때 원하는 위치 만 표시합니다. 이것은 브라우저 위쪽에서 2800 픽셀입니다.스타일 매김 페이지 링크

2 ~ n 페이지의 경우 페이지 매김중인 HTML 테이블의 맨 아래와 페이지 매김 링크 사이에 약 100 픽셀의 여분의 공간이 있습니다. (I. E. 링크는 브라우저 위쪽에서 약 2900 픽셀입니다.)

페이지 n (마지막 페이지)에서 페이지 매김 링크는 브라우저 상단에서 약 5600 픽셀 떨어진 곳에 나타납니다. 이렇게하면 매김 처리중인 HTML 표의 맨 아래와 링크 자체 사이에 많은 공백이 추가됩니다.

사용자가 어떤 페이지에 있더라도 브라우저의 상단에서 2800 픽셀의 링크를 만들 수있는 아이디어가 있습니까? 사전에

감사합니다,

페이지 매김 코드 :

if ($currentpage > 1) { 
    echo " <div class='pages'><a href='http://www...com/phoenix/index.php?currentpage=1' class='links'><<</a></div> "; 
    $prevpage = $currentpage - 1; 
    echo " <div class='pages'><a href='http://www...com/phoenix/index.php?currentpage=$prevpage' class='links'><</a></div> "; 
} 
for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) { 
    if (($x > 0) && ($x <= $totalpages)) { 
     if ($x == $currentpage) { 
     echo " <div class='pages'>[<b>$x</b>] </div>"; 
     } else { 
    echo " <div class='pages'><a href='http://www...com/phoenix/index.php?currentpage=$x' class='links'>$x</a></div> "; 
     } 
    } 
} 
if ($currentpage != $totalpages) { 
    $nextpage = $currentpage + 1; 
    echo " <div class='pages'><a href='http://www...com/phoenix/index.php?currentpage=$nextpage' class='links'>></a></div> "; 
    echo " <div class='pages'><a href='http://www...com/phoenix/index.php?currentpage=$totalpages' class='links'>>></a></div> "; 
} 

CSS의 : 당신이 원하는 것처럼

.pages 
    { 
    color: #000000; 
    overflow: hidden; 
    display: block; 
    float: left; 
    margin: 4px; 
    margin-top: 2800px; 
    margin-bottom:0px; 
    margin-left: 10px; 
    padding-bottom: 0px; 
    font-family: Georgia, "Times New Roman", Times, serif; 
    font-size: 24px; 
    }  


a.links:link { 
    color: #004284; text-decoration: none; 
    text-align:center; 
    margin-left:8px; 
    margin-bottom:0px; 
    padding:2px; 
    font-family: Georgia, "Times New Roman", Times, serif; 
    font-size: 24px; 
    } 

a.links:visited { 
    color: #004284; text-decoration: none; 
    text-align:center; 
    margin-left:8px; 
    margin-bottom:0px; 
    padding:2px; 
    font-family:Georgia, "Times New Roman", Times, serif; 
    font-size: 24px; 
    } 

a.links:active { 
    color: #004284; text-decoration: none; 
    text-align:center; 
    margin-left:8px; 
    margin-bottom:0px; 
    padding:2px; 
    font-family:Georgia, "Times New Roman", Times, serif; 
    font-size: 24px; 
    } 

a.links:hover { 
    color: #FFFFFF; text-decoration: none; 
    background-color: #004284; 
    text-align:center; 
    margin-left:8px; 
    margin-bottom:0px; 
    padding:2px; 
    font-family:Georgia, "Times New Roman", Times, serif; 
    font-size: 24px; 
    } 

답변

0

내가 제대로 읽고 있어요 경우 소리 위치 : 절대, 상단 : 2800px on .pages.

그러나 낮은 위치에 배치하는 것이 좋지 않다고 생각됩니다. 페이지가 2800px보다 짧으면 링크가 손실 될 수 있습니다.