[英]How to convert paging element from PNG/SVG to HTML?
这些数字可以动态更改,只需使用 class text-2
和text-5
为您的 div 提供 ID(也更改 class 名称),使用document.getElementById("")
获取它们并使用innerHTML
/ 更改它们的值innerText
/ textContent
您的 HTML 可能看起来像这样。
<div class="parent">
<div class="line"></div>
<div class="pagination">
<div class="text-2">2</div>
<div class="text-slash">/</div>
<div class="text-5">5</div>
</div>
<div class="line"></div>
</div>
您的 CSS 可能看起来像这样
.line {
width: 2px;
height: 60px;
background-color: #000;
}
.pagination {
display: flex;
width: 50%;
height: 60px;
justify-content: center;
align-items: center;
}
.text-2 {
margin-bottom: 10px;
}
.text-slash {
color: red;
font-size: 20px;
}
.text-5 {
margin-top: 10px;
}
.parent {
display: flex;
width: 100px;
height: 200px;
flex-direction: column;
align-items: center;
justify-content: center;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.