How to make a Pagination
using HTML and CSS ?
GeeksforGeeks
A Computer Science Portal for Geeks
Interview Experiences:
Share Your Questions/Experience or share
your "Interview Experience", please mail
your interview experience to
contribute@geeksforgeeks.org. Also, to
share interview questions, please add
questions at Contribute a Question! You
can also find company specific Interview
Questions at our PRACTICE portal !
设计结构:在上一节中,我们创建了将要使用CSS的基本网站的结构。
CSS代码看起来不错的结构:
/* header styling */
h1 {
color: green;
}
/* pagination position styling */
.pagination_section {
position: absolute;
top: 500px;
right: 230px;
}
/* pagination styling */
.pagination_section a {
color: black;
padding: 10px 18px;
text-decoration: none;
}
/* pagination hover effect on non-active */
.pagination_section a:hover:not(.active) {
background-color: #031F3B;
color: white;
}
/* pagination hover effect on active*/
a:nth-child(5) {
background-color: green;
color: white;
}
a:nth-child(1) {
font-weight: bold;
}
a:nth-child(7) {
font-weight: bold;
}
.content {
margin: 50px;
padding: 15px;
width: 800px;
height: 200px;
border: 2px solid black;
}
组合HTML和CSS代码:这是以上两个部分的组合的最终代码。
How to make a Pagination
using HTML and CSS ?
/* header styling */
h1 {
color: green;
}
/* pagination position styling */
.pagination_section {
position: absolute;
top: 500px;
right: 230px;
}
/* pagination styling */
.pagination_section a {
color: black;
padding: 10px 18px;
text-decoration: none;
}
/* pagination hover effect on non-active */
.pagination_section a:hover:not(.active) {
background-color: #031F3B;
color: white;
}
/* pagination hover effect on active*/
a:nth-child(5) {
background-color: green;
color: white;
}
a:nth-child(1) {
font-weight: bold;
}
a:nth-child(7) {
font-weight: bold;
}
.content {
margin: 50px;
padding: 15px;
width: 700px;
height: 200px;
border: 2px solid black;
}
GeeksforGeeks
A Computer Science Portal for Geeks
Interview Experiences:
Share Your Questions/Experience or share
your "Interview Experience", please mail
your interview experience to
contribute@geeksforgeeks.org. Also, to
share interview questions, please add
questions at Contribute a Question! You
can also find company specific Interview
Questions at our PRACTICE portal !
来源:https://www.cnblogs.com/xiewangfei123/p/12842344.html