html - 未排序列表的整页边框

标签 html css

我有一个水平无序列表,列表几乎是屏幕的一半宽度。

问题是 border-bottom 应用于最后一个 <li>元素未扩展到页面的整个宽度。

.pageContent .filters{
    margin:0px;
    padding:0px;
    list-style:none;
}
.filters li{
    float:left;
    display:inline;
    border-right:1px solid #e5e6e7;
    border-bottom:1px solid #e5e6e7;    
}
.filters li:last-child{
    border-right:none;
}
.filters li:hover{
    background-color:#fcfcfc;
}
.filters li a{
    display:block;
    padding: 12px 35px;
    font-size: 18px;
    color:#353535;
    text-transform:capitalize;
    font-family:'regular';
}

最佳答案

这应该可以满足您的需求。

使用以下 CSS,您可以得到:http://jsfiddle.net/6AGTM/

.filters{
  margin:0px;
  padding:0px;
  list-style:none;
  overflow: hidden; /* make container the same height as floating elements inside */
  border-bottom:1px solid #e5e6e7; /* apply border to this element which goes to edge of page */
  }
.filters li{
  float:left;
  display:inline;
  border-right:1px solid #e5e6e7;
  /* remove border-bottom from here */
  }
.filters li:last-child{
  border-right:none;
  }
.filters li:hover{
  background-color:#fcfcfc;
  }
.filters li a{
  display:block;
  padding: 12px 35px;
  font-size: 18px;
  color:#353535;
  text-transform:capitalize;
  font-family:'regular';
  }

关于html - 未排序列表的整页边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20349222/

相关文章:

html - 文本未显示在我的 Bootstrap 文本区域中

jquery - 使用 jQuery 选择器选择有 child 但没有孙子的元素

php - 如何更改xdebug输出的颜色?

html - 如何在不被跟踪的情况下从 Twitter 加载个人资料图片?

jquery - 只用 jQuery 建一个网站?

html - 顶部导航栏位于侧导航栏下方

javascript - Material-UI:如何在 TreeView 中添加边框

javascript - 使用 angularJs 重定向 - 但仅限于 div/主元素内部

css - 有什么方法可以淡化 CSS ":active"样式,或者使用动画吗?

css - 同位素砌体 - 显示内容错误