1

I have used the simple php pagination, but now i have to add some style on my pagination. but i dont know how to add the css style in php variable. Here is my code:

   for($number=1;$number<=$messageCount;$number++)
                        {
                            echo '<a href="?page=' .$number. '">' .$number. ' &nbsp;</a>'; 

                        }
                        //echo "<br> Current Page: $page";

I want to add the style to $number variable.

1 Answer 1

1

Please tell us what you've tried so far? From what I gather you're asking for a style to be added to your $number?

PHP

echo '<a href="?page=' .$number. '"><span class="cssClassName">' .$number. '</span></a>';

CSS

<style>
    span.cssClassName {
         /* Add your styling here */
         margin: 0 10px 0 0; /* Gets rid of the use of &nbsp; to space them out */
    }
</style>
Sign up to request clarification or add additional context in comments.

1 Comment

it works, i already did that, btw thanks for your response !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.