2016-09-15 3 views
-2

私が欲しいのは次のようなものです:ボタンを内側に入れる方法は?

-------------------ボタン-------------- ----

私は行内にテキストを配置する方法を知っていますが、ボタンを置くとそれは良く見えません。なにか提案を?

+1

私はあなたがこれまでにしようとしているものを私たちに示し、その後、ライン*内のテキストを配置する方法を知っています*。 – vivekkupadhyay

+0

スクリーンショットを追加すると、私は問題を見ませんでした:https://codepen.io/anon/pen/zKqaNP –

+0

両側に水平線を入れたい


--------その例 – None

答えて

2

afterbeforeを使用して行を追加できます。

button { 
 
    padding: 0 100px; 
 
    overflow: hidden 
 
} 
 
button span { 
 
    display: inline-block; 
 
    position: relative; 
 
    height: 100%; 
 
} 
 
button > span:after { 
 
    content: ''; 
 
    border-bottom: 1px dotted #000; 
 
    height: 1px; 
 
    width: 1000%; 
 
    position: absolute; 
 
    left: calc(100% + 5px); 
 
    top: calc(50% - 1px); 
 
} 
 
button > span:before { 
 
    content: ''; 
 
    border-bottom: 1px dotted #000; 
 
    height: 1px; 
 
    width: 1000%; 
 
    position: absolute; 
 
    right: calc(100% + 5px); 
 
    top: calc(50% - 1px); 
 
}
<button type="button"> 
 
    <span>Button</span> 
 
</button>

関連する問題