Jump to content

How to make circled pagination


newcoder1010

Recommended Posts

Hello,

 

I have this pagination:

<ul class="pagination">
<li class="active"><span>1</span></li>
<li><a title="Go to page 2" href="/?q=home&page=1">2</a></li>
<li><a title="Go to page 3" href="/?q=home&page=2">3</a></li>
</ul>

When active, I would like to make the color circled plus red.

When not active, i would like to make the color circled plus blue.

 

I have tried several different ways but I could not do it. Can you please help me with the css?

 

Thanks.

Link to comment
Share on other sites

Set the <span> and <a> elements in the list to be blocks.

 

Give them a fixed width and height that are both the same then set the border-radius to half that width.

 

Give them a background color or a border, whichever you prefer.

 

Use the .active span selector to set the span to be red.

Link to comment
Share on other sites

I tried the below code. I think something is overwriting. I am getting the partial results. Two main issues: not being circled and not having the blue color.

 

#block-views-testimonial-slideshows-block-1 .pagination li {
    float: left;
    margin: 25px;
    width: 10px;
    height: 10px; /* if i remove this, still same result */
    border-radius: 5px; /* if i remove this, still same result */
    font-size: 20px;
    line-height: 100px;
    text-align: center;
    background: blue;   /* not getting blue */

}

 

Below is working.

    #block-views-testimonial-slideshows-block-1 .pagination span{


    background: red;
    }

Please see the image.

post-168746-0-81319500-1476546701_thumb.png

Edited by newcoder1010
Link to comment
Share on other sites

Style the span and a elements, not the list items.

.pagination li span, .pagination li a {
  display: block;
  width: 1.5em;
  height: 1.5em;
  line-height: 1.5em;
  text-align: center;
  border-radius: 0.75em;
  color: white;
  background-color: blue;
}

.pagination .active span {
  background-color: red;
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...