html - 更改下一步和后退按钮之间的空间

标签 html css wordpress pagination themes

我正在使用 The Point 主题,我试图将上一页按钮移动到左侧,我查看了 Styles.css 文件并想出了如何在右侧制作下一页,但我想不通如何扩大两个按钮之间的空间并使上一页按钮位于左侧,它们只是堆叠在一起...

截图如下:

https://imgur.com/z9qiTNG

这是来自 styles.css 文件的分页代码:

/* Pagination */
nav.posts-navigation { clear: both }
.pagination {
	clear: both;
	overflow: hidden;
	width: 100%;
	margin: 5px auto;
	text-align: center;
	font-size: 18px;
}
.single .pagination {
	border: 0;
	box-shadow: none;
	-moz-box-shadow: none;
	-webkit-box-shadow: none;
	margin-top: 0;
	padding: 3% 0;
	width: 100%;
	text-align: right;
}
.pagination ul {
	list-style: none;
	margin: 0;
	display: inline-block;
}
.pagination ul li {
	display: inline-block;
	margin-bottom: 5px;
}
.pagination .current, .pagination .dots, .pagination a:hover {
	color: #fff;
	margin: 0 1px 0 0;
	display: inline-block;
	line-height: 1;
	text-decoration: none;
	padding: 10px 13px;
	background: #2a2a2a;
	font-weight: bold;
	margin-bottom: 10px;
}
.single .pagination .current {
	padding: 0;
	margin: 0;
	background: transparent;
}
.single .pagination a .currenttext {
	padding: 0;
	background: transparent;
	color: #FFF;
	margin-right: 0;
	margin-bottom: 0;
}
.single .pagination a:hover .currenttext { color: #fff }
.pagination a {
	background: #38B7EE;
	margin: 0 1px 0 0;
	display: inline-block;
	line-height: 1;
	text-decoration: none;
	color: #fff;
	padding: 10px 13px;
	transition: all 0.25s linear;
	font-weight: bold;
	margin-bottom: 10px;
}
.pagination ul li:last-child a { margin-right: 0 }
.pagination a:hover { color: #fff }
.pagination i.icon-left { margin-right: 7px }
.pagination i.icon-right { margin-right: 7px }
.top {
	float: right;
	position: absolute;
	left: 50%;
	top: -18px;
	width: 52px;
	height: 52px;
	margin-left: -26px;
	background: #eee;
	border-top: 1px solid #ddd;
	border-radius: 30px;
	-webkit-border-radius: 30px;
	-moz-border-radius: 30px;
	z-index: 100;
}
.pnavigation2 {
	display: block;
	width: 100%;
	overflow: hidden;
	padding: 15px 0;
	float: left;
	margin-top: 20px;
}
.pagination .nav-previous { float: left }
.pagination .nav-next { float: right }
.pagination .nav-previous a, .pagination .nav-next a { color: #fff!important }
.pagination .nav-previous a:hover, .pagination .nav-next a:hover { background-color: #222 }
.single .currenttext { margin-bottom: 0 }
.pagination .current .currenttext { margin-bottom: 10px }

最佳答案

一种方法是使用 Flexbox 和 justify-content: space-between。每个链接按钮( flex 子元素)固定到父元素的任一 Angular 。

.pagination {
  display: flex;
  justify-content: space-between;
}

.btn {
  background-color: #35bbee;
  padding: 10px 15px;
  color: white;
  text-decoration: none;
}
<div class="pagination">
  <a class="btn btn-prev" href="#">Previous Page</a>
  <a class="btn btn-next" href="#">Next Pages</a>
</div>

jsFiddle

关于html - 更改下一步和后退按钮之间的空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59309629/

相关文章:

css - 在 Bootstrap 3 输入旁边放置一些文本

javascript - 如何在 ScrollPane 2 中保留特定的滚动条

php - 创建单品模板

html - Flexbox child 不尊重其 parent 的边界

javascript - 如何使用 MSE 在视频标签中播放 H.264 NAL 单元流?

javascript - 无法让 JavaScript 代码在 Firefox 上运行

html - 使 div 无响应但不影响 foundation zurb 中的父 div

css - 水平菜单合理定位元素

php - 如何使用 get_theme_mod 获取图像的替代文本?

html - 背景内容图片需要贴在底部