Curriculum
Course: CSS Advanced
Login

Curriculum

CSS Advanced

CSS Rounded Corners

0/1

CSS Border Images

0/1

CSS Color Keywords

0/1

CSS Text Effects

0/1

CSS 2D Transforms

0/1

CSS 3D Transforms

0/1

CSS Transitions

0/1

CSS Animations

0/1

CSS Tooltip

0/1

CSS Style Images

0/1

CSS Image Reflection

0/1

CSS Masking

0/1

CSS Buttons

0/1

CSS Multiple Columns

0/1

CSS User Interface

0/1

CSS Box Sizing

0/1

CSS Media Queries

0/1
Text lesson

CSS Pagination Examples

Simple Pagination

If your website features numerous pages, you might want to consider implementing pagination on each page.

IMG_3693

Example 

.pagination {
  display: inline-block;
}

.pagination a {
  color: black;
  float: left;
  padding: 8px 16px;
  text-decoration: none;
}

Active and Hoverable Pagination

IMG_3692

Use an .active class to indicate the current page and employ the :hover selector to adjust the color of each page link when hovering over them.

Example 

.pagination a.active {
  background-color: #4CAF50;
  color: white;
}

.pagination a:hover:not(.active) {background-color: #ddd;}

 

Rounded Active and Hoverable Buttons

IMG_3694

Incorporate the border-radius property to achieve rounded edges for both the “active” and “hover” button states.

Example 

.pagination a {
  border-radius: 5px;
}

.pagination a.active {
  border-radius: 5px;
}

Hoverable Transition Effect

IMG_3695

Include the transition property in the page links to generate a transition effect when hovering over them.

Example 

.pagination a {
  transition: background-color .3s;
}

 

Bordered PaginationIMG_3696

Apply the border property to introduce borders to the pagination design.

 

Example 

.pagination a {
  border: 1px solid #ddd; /* Gray */
}

 

Rounded Borders

Suggestion: Incorporate rounded borders for the first and last links in your pagination.

Image

Example 

.pagination a:first-child {
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

.pagination a:last-child {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

Space Between Links

Suggestion: Utilize the margin property to avoid grouping the page links together.IMG_3698

 

Example 

.pagination a {
  margin: 0 4px; /* 0 is for top and bottom. Feel free to change it */
}

Pagination Size

IMG_3700

Adjust the size of the pagination using the font-size property.

 

Example 

.pagination a {
  font-size: 22px;
}

Centered Pagination

IMG_3700

To center the pagination, wrap a container element (such as a <div>) around it and apply text-align:center to the container.

 

Example 

.center {
  text-align: center;
}

More Examples

Example 

IMG_3701

Breadcrumbs

IMG_3702

Another type of pagination is commonly referred to as “breadcrumbs.”

 

Example 

ul.breadcrumb {
  padding: 8px 16px;
  list-style: none;
  background-color: #eee;
}

ul.breadcrumb li {display: inline;}

ul.breadcrumb li+li:before {
  padding: 8px;
  color: black;
  content: “/\00a0”;
}