html - 如何在css中实现这种边框效果?

标签 html css

fiddle :
https://jsfiddle.net/aronlilland/bsmL1kx7/

现在我一直在努力寻找如何围绕 CSS 中的元素制作以下边框效果,特别是每个行元素之间的边框,如“signature serveice”。 “facebook 监视器”等。我可以通过将 div 行与下面的行间隔 1px appart 来实现这种外观吗?或者我怎样才能最好地做到这一点?在我看来,每个形状周围都有一个浅色边缘边框,简单的问题,简单的答案

谢谢!

enter image description here

    .table {
      background: #1e2129;
      width: 375px;
    }
    .row1 {
      width: 100%;
      line-height: 100px;
      background: #272a34;
      margin-bottom: 1px;
      text-align: center;
      color: #fff;
      font-family: helvetica;
    }
    .row2 {
      width: 100%;
      line-height: 100px;
      background: #313641;
      margin-bottom: 1px;
      text-align: center;
      color: #fff;
      font-family: helvetica;
    }

最佳答案

在我看来,它们只是顶部的边框较浅,底部的边框较深。没有什么花哨。颜色不完全匹配,但您明白了:

article {
  border-radius: 20px;
  background-color: #44ccff;
  color: white;
}

article header,
article section div {
  background-color: #445; 
}
article section div:nth-child(odd) {
  background-color: #333344;
}
article section div {
  border-top: 2px solid #556;
  border-bottom: 2px solid #223;
}
<article>
<h2>StarterPackage</h2>
<header>Here you can type...</header>
<section>
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
  <div>Item 4</div>
  <div>Item 5</div>
</section>
</article>

关于html - 如何在css中实现这种边框效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34622422/

相关文章:

javascript - 如何在数字输入字段中以这种 'xxx-xxx-xxxx' 格式输入电话号码

html - HTML 和 CSS 中的流体 3 列布局

javascript - 在 html/css 中调整图像大小和居中?

javascript - 选择子菜单后如何使导航栏的主菜单处于事件状态(突出显示)

html - 仅使用 CSS 模拟选择框

html - 悬停时如何避免元素调整大小

jquery - 如何用CSS倾斜图像?

css - IE/Edge 是否适本地为 calc() CSS 规范设置动画?

html - 在 Firefox 中显示返回 HTTP 503 的图像

javascript - polymer 的双向数据绑定(bind)在元素的子属性值中不起作用