我有箭头按钮,因为<<
和>>
之间有一个主 div 块。这个主 div 必须是position:absolute
因为有其他隐藏的 div 元素重叠。
我遇到的问题是>>
我想定位在主 div 右侧的箭头按钮。
这是我的JS BIN。
.pg-wrapper div {
background-color: lightgrey;
position:absolute;
}
.left {
display:inline-block
}
.pg-wrapper {
position: relative;
width: 180px;
height: 20px;
display:inline-block;
overflow: hidden;
vertical-align: middle;
}
.right {
display: inline-block;
}
在 pg-wrapper css 类中设置高度和宽度
like this
.pg-wrapper {
float:left;
height:27px;
width:188px;}
我浮动到右侧的箭头,并在 div 周围设置了一个父级。它似乎已经完成了您想要的(这次)。
.right {
position:relative;
display: block;
float:right;
}
.wrapper { width:265px; }
像这样
css
ul {
list-style-type: none;
}
.nav-step li {
float: left;
background-color: lightgrey;
color: white;
padding: 5px 20px;
border: 1px solid grey;
position: relative;
margin: 10px;
}
.nav-step li:after {
content: '';
width: 100%;
height: 2px;
background: grey;
position: absolute;
left: -50%;
top: 14px;
z-index: -1
}
.nav-step li:first-child:after {
content: none;
}
.nav-step .active {
background-color: white;
color: grey;
}
.pg-wrapper div {
background-color: lightgrey;
position:absolute;
}
.left {
display:inline-block;
margin:0 -3px;
padding:0;
}
.pg-wrapper {
position: relative;
width: 180px;
height: 20px;
display:inline-block;
overflow: hidden;
vertical-align: middle;
}
.right {
display: inline-block;
margin:0 -4px;
padding:0;
}