【问题标题】:CSS Ribbon - controlling the width of the sidesCSS Ribbon - 控制边的宽度
【发布时间】:2014-10-21 14:50:08
【问题描述】:
.ribbon {
  width: 288px;
  position: absolute;
  top: 123px;
  left: 250px;
  background: #000;
  font-family: 'Lobster Two', Helvetica, sans-serif;
  font-size: 30px;
  letter-spacing: 1px;
  font-style: italic;
  line-height: 60px;
  height: 60px;
  font-weight: normal;
}
.ribbon:before, .ribbon:after {
  content: '';
  position: absolute;
  display: block;
  border: 30px solid #333333;
  z-index: -1;
}
.ribbon:before {
  left: -33px;
  top: -10px;
  border-left-width: 15px;
  border-left-color: transparent;
}
.ribbon:after {
  right: -33px;
  bottom: -10px;
  border-right-width: 15px;
  border-right-color: transparent;
}

.. 但我不能完全控制边的宽度使其看起来像这样:

【问题讨论】:

  • 问题是有空间吗?

标签: css shapes css-shapes


【解决方案1】:

您可以在::before 上使用border-right-width::after 上的border-left-width: 来实现此目的。至少,当我这样做时,它可以在那支笔中工作。

http://codepen.io/anon/pen/wHCeA

钢笔演示。

【讨论】:

  • 即只需减少两侧的右/左边框的宽度。从30px 到任何地方。
猜你喜欢
  • 2016-01-29
  • 1970-01-01
  • 1970-01-01
  • 2019-01-18
  • 2014-06-09
  • 1970-01-01
  • 2020-10-28
  • 1970-01-01
  • 2017-08-24
相关资源
最近更新 更多