2

hr 要素を自分の好みに合わせてスタイルするための解決策を見つけるのに苦労しています。

次のフィドルを見ると、hr 要素に :before と :after の両方の擬似が追加されていることがわかります。

http://jsfiddle.net/MattStrange/LGEjp/

これまでのところ、これは私が望むものです。両側の両方の円は正しいですが、線の正確な中心に画像を追加したいのですが、両方の擬似が使用されているため、背景画像を追加する方法がわかりませんこの時間。

<hr class="bolt">
hr {
  border: 0 solid #eeedef;
  border-top-width: 1px;
  height: 0;
  margin-top: 60px;
  margin-bottom: 60px;
  float: left;
  clear: both;
  display: block;
  width: 100%;
  position: relative;
}
hr:before, hr:after {
  content: " ";
  width: 5px;
  height: 5px;
  position: absolute;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
  border: 1px solid #e5e5e5;
  background-color: #fff;
}
hr:before {
  left: 0;
  bottom: -3px;
}
hr:after {
  bottom: -3px;
  right: 0;
}

大変助かりました。

乾杯

4

1 に答える 1