Html 带浮动的绝对位置

Html 带浮动的绝对位置,html,css,Html,Css,我有两个箭头按钮,分别是,中间有一个主div块。 这个主div必须是位置:绝对的,因为还有其他隐藏的div元素 这是重叠的 我遇到的问题是,我想将>箭头按钮放置在主div的右侧 这是我的。我浮动到右侧的箭头,并在div周围设置了一个父项。它似乎已经完成了您想要的操作(这次) 我飘到右边的箭头,在div周围设置了一个父对象。它似乎已经完成了您想要的(这次) 像这样 css ul { list-style-type: none; } .nav-step li { float:

我有两个箭头按钮,分别是
,中间有一个主div块。 这个主div必须是
位置:绝对的
,因为还有其他隐藏的div元素 这是重叠的

我遇到的问题是,我想将
>
箭头按钮放置在主div的右侧


这是我的。

我浮动到右侧的箭头,并在div周围设置了一个父项。它似乎已经完成了您想要的操作(这次)


我飘到右边的箭头,在div周围设置了一个父对象。它似乎已经完成了您想要的(这次)

像这样

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;
}
像这样

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;
}


在pg wrapper css类中设置高度和宽度

like this
        .pg-wrapper {
                 float:left;
                 height:27px;
                 width:188px;}

在pg wrapper css类中设置高度和宽度

like this
        .pg-wrapper {
                 float:left;
                 height:27px;
                 width:188px;}

浮动:对吗?现在它向左浮动
float:right
将在大屏幕中产生巨大的间隙。那么
float:right
呢?现在它向左浮动
float:right
将在大屏幕上产生巨大的间隙。您好,谢谢您的输入,但我希望它靠近主div,而不是在大屏幕上有很大的距离。您好,谢谢您的输入,但我希望它靠近主div,而不是在大屏幕上有很大的距离。我提到了div块必须具有
position:absolute
因为在同一位置必须有其他重叠/隐藏的div块。我提到div块必须有
position:absolute
因为在同一位置必须有其他重叠/隐藏的div块。@Seong Lee我的答案有用吗?@Seong Lee我的答案有用吗?