Home  >  Article  >  Web Front-end  >  A brief discussion on how to use the Pagination component of Bootstrap5

A brief discussion on how to use the Pagination component of Bootstrap5

青灯夜游
青灯夜游forward
2021-10-20 11:24:402509browse

This article will introduce to you the usage of the Pagination component in Bootstrap5. I hope it will be helpful to everyone!

A brief discussion on how to use the Pagination component of Bootstrap5

[Related recommendation: "bootstrap tutorial"]

1. Simple example

Page navigation is generally used for article list pages, download lists, picture lists, etc. Because there is a lot of data, it is impossible to display it on one page. Generally, page navigation includes previous page, next page, digital page number, etc. The following is a simple example:

      

A brief discussion on how to use the Pagination component of Bootstrap5

2. Use icons

Use icons or symbols to replace certain paging links. Text.

A brief discussion on how to use the Pagination component of Bootstrap5

3, disabled and active status

Paging links can be customized according to different situations. Use disabled for links that appear to be unclickable, and active for links that appear to be on the current page.

Although the .disabled class uses pointer-events: none to attempt to disable a's link functionality, the CSS properties have not been standardized and keyboard navigation is not considered. Therefore, you should always add tabindex="-1" on disabled links and use custom JavaScript to completely disable their functionality.

A brief discussion on how to use the Pagination component of Bootstrap5

4. Size

Like larger or smaller pagination? Add pagination-lg or pagination-sm, or use another size.

      
       

        

A brief discussion on how to use the Pagination component of Bootstrap5

#5. Alignment

The default paging navigation is left aligned. Foreigners are more accustomed to left alignment. We Chinese like to be centered. You can use the flexible box general class Change the alignment of the pagination component. Just add justify-content-center to the ul class. Of course, you can also use justify-content-end to align to the right, although this is rare.



A brief discussion on how to use the Pagination component of Bootstrap5

If this article is helpful to you, please remember to like it!

For more programming-related knowledge, please visit: Programming Video! !

The above is the detailed content of A brief discussion on how to use the Pagination component of Bootstrap5. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:juejin.cn. If there is any infringement, please contact admin@php.cn delete