Open In App

How to Change the Size of the Pagination using CSS ?

Last Updated : 21 Mar, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Pagination is an important user interface component that enables navigation through a set of pages. We can customize this element by adjusting its size.

These are the two different approaches to customize and change the pagination size using CSS:

Using font-size Property

In this approach, we are customizing the pagination size by using the CSS font-size property. The two different paginations have been displayed each having a different size.

Syntax:

font-size: value;

Example: The below example uses font-size Property to Change the size of the pagination using CSS.

HTML
<!DOCTYPE html>
<html>

<head>
  <title>Using font-size Property</title>
    <style>
        .pag1 {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
        }

        .pag1 a {
            color: black;
            padding: 10px 15px;
            text-decoration: none;
            transition: background-color .3s;
            border: 2px solid #3498db;
            background-color: #ffffff;
            font-size: 26px;
            margin: 0 5px;
            border-radius: 5px;
        }

        .pag1 a.active {
            background-color: #4CAF50;
            border: 2px solid #4CAF50;
        }

        .pag2 {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 20px;
        }

        .pag2 a {
            color: green;
            padding: 8px 12px;
            text-decoration: none;
            transition: background-color .3s;
            border: 2px solid #e74c3c;
            background-color: #ffffff;
            font-size: 8px;
            margin: 0 8px;
            border-radius: 6px;
        }
    </style>
</head>

<body>
    <br>
    <h1 style="color: green; text-align: center;">
          GeeksforGeeks
      </h1>
    <h3 style="text-align: center">
          Using font-size Property
      </h3>
    <div class="pag1">
        <a href="#">&#9665;</a>
        <a href="#">1</a>
        <a href="#">2</a>
        <a href="#">3</a>
        <a href="#">4</a>
        <a href="#">5</a>
        <a href="#">6</a>
        <a href="#">&#9655;</a>
    </div>
    <div class="pag2">
        <a href="#">&#9665;</a>
        <a href="#">1</a>
        <a href="#" class="active">2</a>
        <a href="#">3</a>
        <a href="#">4</a>
        <a href="#">5</a>
        <a href="#">6</a>
        <a href="#">&#9655;</a>
    </div>
</body>

</html>

Output:

Example-1

Using Scaling

In this approach, we are using the CSS transform property with the scale function to change the size of pagination components. The transform-origin property makes sure scaling from the center, and different classes (scaled-pagination and larger-scaled-pagination) provide distinct scale factors for various-sized and larger-sized paginations.

Syntax:

 transform: scale(1.2);

Example: The below example uses Scaling to Change the size of the pagination using CSS.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Using Scaling</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            padding: 20px;
        }

        .pag1 {
            display: inline-block;
            margin: 10px;
            border: 1px solid #ddd;
            overflow: hidden;
            transform: scale(1);
        }

        .pag2 {
            display: inline-block;
            margin: 10px;
            border: 1px solid #ddd;
            overflow: hidden;
            transform-origin: center;
            transform: scale(1.5);
        }

        .pag3 {
            display: inline-block;
            margin: 10px;
            border: 1px solid #ddd;
            overflow: hidden;
            transform-origin: center;
            transform: scale(2.5);
        }
    </style>
</head>

<body>
    <br>
    <h1 style="color: green;">
      GeeksforGeeks
      </h1>
    <h3>Using Scaling</h3>
    <div class="pag1">
        <a href="#">&#8592;</a>
        <a href="#">1</a>
        <a href="#">2</a>
        <a href="#">3</a>
        <a href="#">4</a>
        <a href="#">5</a>
        <a href="#">6</a>
        <a href="#">&#8594;</a>
    </div>
    <br>
    <div class="pag2">
        <a href="#">&#8592;</a>
        <a href="#">1</a>
        <a href="#">2</a>
        <a href="#">3</a>
        <a href="#">4</a>
        <a href="#">5</a>
        <a href="#">6</a>
        <a href="#">&#8594;</a>
    </div>
    <br><br>
    <div class="pag3">
        <a href="#">&#8592;</a>
        <a href="#">1</a>
        <a href="#">2</a>
        <a href="#">3</a>
        <a href="#">4</a>
        <a href="#">5</a>
        <a href="#">6</a>
        <a href="#">&#8594;</a>
    </div>
</body>

</html>

Output:

Screenshot-2024-03-12-at-19-34-27-Example-2


Similar Reads

React Suite Pagination Size
React Suite is a front-end library designed for the middle platform and back-end products. React Suite Pagination component allows the user to select a specific page from a range of pages. Size Prop is used to set the size of the Pagination component. There are four alternatives that are available. xs: the smallest size that is availablesm: it is t
2 min read
Create a Pagination Component using HTML CSS and JavaScript
In this article, we are going to create a pagination component using HTML, CSS, and JavaScript. Websites may need multiple pages to display the items for easier navigation and better user experiences. If you are looking to display large amounts of data on your site, like a blog, charts, or graphs that show information about the same data set, you w
3 min read
How to make a Pagination using HTML and CSS ?
Creating pagination is quite simple, you can easily do that by using Bootstrap, and JavaScript. However, in this article, we will use HTML and CSS to create pagination.  Pagination is helpful when the website contains lots of content on a single page, and a single page will not look good with all those topics together. Few websites use the scroll t
3 min read
How to Add Hoverable Pagination using CSS ?
Pagination is a common technique for controlling content that covers multiple pages. Hoverable pagination provides a sleek alternative to traditional pagination styles by enabling users to preview the content without clicking by hovering over the pagination elements. Traditional pagination styles require users to click through numbered links to nav
2 min read
How to Create a Transition Effect on Hover Pagination using CSS ?
In web development, pagination is a common feature used to navigate through a large set of data or content. Adding a transition effect on hover to pagination buttons can enhance user interaction and provide visual feedback. ApproachIn this approach, we are going to use CSS transitions. It enables smooth changes in CSS property values over a specifi
1 min read
Create a Pagination using HTML CSS and JavaScript
In this article, we will create a working pagination using HTML, CSS, and JavaScript. Pagination, a widely employed user interface­ pattern, serves the purpose of dividing extensive­ data or content into more manageable­ portions. It allows users the ability to effortle­ssly navigate through numerous content pages, facilitating their search for spe
5 min read
Create Pagination UI Using React And Tailwind CSS
When working with huge data sets in online applications, pagination is an essential feature. It makes a lengthy list of items easier to browse through by dividing them into digestible parts. This article will tell you how to use Tailwind CSS for styling and React for front-end functionality to create a pagination user interface. Prerequisites React
3 min read
CSS Pagination
Pagination is the process of dividing the document into pages and providing them with numbers. Types of Pagination: There are many types of pagination in CSS. Some of them are given below: Simple PaginationActive and Hoverable PaginationRounded Active and Hoverable ButtonsHoverable Transition EffectBordered PaginationRounded Border PaginationCenter
7 min read
Primer CSS Previous/Next Pagination
Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, an
2 min read
Materialize CSS Pagination
Pagination is used to separate the content into discrete pages that is short and easy to understand. Materialize CSS provide classes to create a pagination bar that holds the links to the other pages. The pagination class is used to set the <ul> list element as a pagination component. The pages that have to be shown are defined inside this co
2 min read
How to we create Pagination in Materialize CSS ?
Materialize CSS is a front-end UI library that is created by Google using the combination of HTML, CSS, and JavaScript. It is basically a design language that combines classic design along with modern innovations and technology. The purpose of Google behind developing Materialize CSS is to provide a unified system design for all their products acro
3 min read
Foundation CSS Kitchen Sink Pagination
Foundation CSS is the frontend framework of CSS that is used to build responsive websites, apps, and emails that work perfectly on any device. It is written using HTML, CSS, and Javascript and is used by many famous companies like Amazon, Facebook, eBay, etc. It uses packages like Grunt and Libsass for fast coding and controlling and Saas compiler
2 min read
Foundation CSS Pagination Basics
Foundation CSS is an open-source & responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails that look amazing & can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is
2 min read
Foundation CSS Pagination Centered
Foundation CSS is an open-source & responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails that look amazing & can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is
2 min read
Foundation CSS Pagination
Foundation CSS is the frontend framework of CSS that is used to build responsive websites, apps, and emails that work perfectly on any device. It is written using HTML, CSS, and Javascript and is used by many famous companies like Amazon, Facebook, eBay, etc. It uses packages like Grunt and Libsass for fast coding and controlling and Saas compiler
3 min read
Primer CSS Numbered Pagination
Primer CSS is open-source on Github that is created with GitHub’s design system. We can use Primer CSS by installing it via npm or include the CDN link in our HTML file. It has different types of styles like spacing, color, and typography. Primer CSS Pagination is used to jump to any related page using the link. Primer CSS Numbered Pagination is us
2 min read
Primer CSS Pagination
Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, an
2 min read
Foundation CSS Pagination Sass Reference
Foundation CSS is an open-source and responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails that look amazing and can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is bui
4 min read
How to Add Borders to Pagination in CSS ?
Add borders to Pagination is when you have many pages of content and must move between them. Making these page buttons look better can make navigating easier and more enjoyable for users. One way to do this is by adding borders to the page buttons using CSS. These are the following approaches: Table of ContentUsing Border PropertyUsing Border-Style
3 min read
How to Change Font Size using CSS?
We can change the font size in CSS using the font-size property to set the size of text in HTML elements. You can specify the size in various units such as pixels, percentages, ems, or rems, allowing precise control over text appearance. Using font-size propertyThe font-size property in CSS sets the size of the text in HTML elements. Values can be
3 min read
How to Hide Elements in Mobile Size and Display in Laptop size using Tailwind CSS ?
Tailwind CSS is a popular utility-first CSS framework that provides a variety of built-in classes for rapid web development. One common requirement is to hide elements on mobile devices while keeping them visible on larger screens, such as laptops or desktops. In this article, we will see two different approaches for hiding elements on mobile devic
3 min read
How to make table searchable and sortable with pagination using jQuery?
The jQuery fancyTable plugin helps the developers to design HTML tables that are searchable and sortable with pagination feature. This plugin is totally based on JavaScript and HTML. Official website for plugin: Please take care of file paths while implementing the codes. https://github.com/myspace-nu/jquery.fancyTable Example 1: The following code
3 min read
How to make Pagination using Angular UI Bootstrap ?
In this article, we will see how to make Dropdown using Angular UI bootstrap Angular UI Bootstrap is an Angular JS framework created by Angular UI developers for providing better UI which can be used easily. Syntax: <div uib-pagination></div> Download AngularUI from the link: https://angular-ui.github.io/bootstrap Approach: First, add A
1 min read
How to implement pagination in React using Hooks?
Implementing pagination in React using hooks involves managing the state of the current page and the number of items per page, as well as rendering the paginated data accordingly. Implementing pagination in React using Hooks:Setup Initial State: Use the useState hook to manage the state for the current page and items per page.import React,{ useStat
3 min read
Pagination using Node, Mongo, Express.js and EJS
In this article, we will dive into the process of implementing pagination in our web application using NodeJS, MongoDB, Express, and EJS for dynamic HTML rendering. Additionally, we'll enhance the visual appeal of our pagination controls with CSS. Our focus will be on creating a user profile system where users can create a new profile and scrolling
4 min read
How to do Pagination in Node.js using Sorting Ids ?
Implementing pagination in a Node.js application involves fetching and displaying data in chunks or pages, typically from a database. One common approach to pagination is using sorting IDs, where each record in the dataset is assigned a unique identifier (ID) that determines its position in the sorted sequence. This method allows you to efficiently
4 min read
How to Create Pagination in Node.js using Skip and Limit ?
Creating pagination in Node.js using the skip and limit methods. This approach efficiently retrieves specific data subsets from a database, improving performance and user experience by loading content in manageable segments rather than all at once. What is Pagination?Pagination is a very helpful method. This allows the client to fetch data in pages
4 min read
Pagination Component using React Hooks
Pagination on websites refers to the way of displaying a large set of data in smaller chunks. In React, it's super easy to create a pagination component with the help of the `useEffect` and `useState` hooks. we will create a pagination component using React hooks. Output Preview: Let us have a look at how the final output will look like. Prerequisi
3 min read
three90RightbarBannerImg