Jump to content

CSS for pagination links


ArizonaJohn

Recommended Posts

Hello,

 

I am having problems with the CSS for the pagination page number links below. What CSS would make the links have the following properties below?

 

Start at an absolute position of 940 px from the top of the screen and 100 px from the right.

 

Be 10 px apart from each other.

 

Thanks in advance,

 

John

 

/******  build the pagination links ******/  
// range of num links to show    

// if not on page 1, don't show back links  
if ($currentpage > 1) {  
   // show << link to go back to page 1  
   echo " <div class='pages'><div class='pages'><a href='{$_SERVER['PHP_SELF']}?currentpage=1&find={$_SESSION['find']}&searching=yes&search=search' class='linksp'><<</a></div> ";  
   // get previous page num  
   $prevpage = $currentpage - 1;  
   // show < link to go back to 1 page  
   echo " <div class='pages'><a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage&find={$_SESSION['find']}&searching=yes&search=search' class='linksp'><</a></div> ";  
} // end if   

// loop to show links to range of pages around current page  
for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) {  
   // if it's a valid page number...  
   if (($x > 0) && ($x <= $totalpages)) {  
      // if we're on current page...  
      if ($x == $currentpage) {  
         // 'highlight' it but don't make a link  
         echo " <div class='pages'>[<b>$x</b>] </div>";  
      // if not current page...  
      } else {  
         // make it a link  
     echo " <div class='pages'><a href='{$_SERVER['PHP_SELF']}?currentpage=$x&find={$_SESSION['find']}&searching=yes&search=search' class='linksp'>$x</a></div> ";  
      } // end else  
   } // end if   
} // end for  

// if not on last page, show forward and last page links      
if ($currentpage != $totalpages) {   
   // get next page  
   $nextpage = $currentpage + 1;  
    // echo forward link for next page   
   echo " <div class='pages'><a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage&find={$_SESSION['find']}&searching=yes&search=search' class='linksp'>></a></div> ";  
   // echo forward link for lastpage  
   echo " <div class='pages'><a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages&find={$_SESSION['find']}&searching=yes&search=search' class='linksp'>>></a></div> ";  
} // end if  
/****** end build pagination links ******/

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.