:after
を使用してspan
要素にマージンを追加しようとしています。Withは次のマージンではありません:次の要素に影響を与えた後?
はなぜ、この、どのようにされています:
.container {
display: flex !important;
justify-content: flex-start !important;
}
.title-border {
width: 3px;
height: 20px;
content: '';
background: rgb(102, 46, 145);
&:after {
display: inline-block margin: 0 8px content: ''
}
}
.horizontal {
display: inline-block;
box-sizing: inherit;
white-space: nowrap;
}
<div class="container">
<span class="title-border">
<span class="horizontal">
Some text
</span>
</span>
</div>
しかし、全く余裕がありません(パープルボーダーとテキストの間にスペースがあるはずです)修理する?
Codepen:https://codepen.io/alexcheninfo/pen/JOepyM
まだスニペットに余白や余白がありません。 – alex
更新コード@アレックスでお試しください – Bhargav