2017-01-30 25 views
1

いくつかの便利なテクニックはありますか?私はこれを使用しようとした下のキャンバスの余白削除するにはdivとキャンバスをグリッドに水平に整列する方法

.wrapper div { 
    position: relative; 
    top: -8px; 
} 

.wrapper canvas { 
    margin-bottom: -5px; 
} 

をしかし、私は常に負回避しようと、私はこれを使用しようとしたテキストのセンタリングのために

Here is the fiddle

パラメーター。

答えて

0

縦方向に整列していましたか?このような?

.wrapper { 
 
    border: 1px solid green; 
 
    display: inline-block; 
 
} 
 
.wrapper div { 
 
    border: 1px solid blue; 
 
    display: inline; 
 
    margin-left: 10px; 
 
} 
 
.wrapper canvas { 
 
    border: 1px solid red; 
 
    display: inline-block; 
 
    vertical-align: middle; 
 
}
<div class="wrapper"> 
 
    <canvas width="32" height="32"></canvas> 
 
    <div class="question">1234567890</div> 
 
</div>

0

これはどういう意味ですか?

canvas { 
    float: left; 
} 
+0

水平設計のため、このコードを使用することができます〜のためにing。 – aptyp

0

あなたははい、おかげで、これは私が見ていたものである

<style> 
.wrapper { 
    border: 1px solid green; 
    float:left; 
} 
.demo_class{ 
    display: inline-block; 
    float: left; 
} 
.demo_class .question{ 
    height: 32px; 
    line-height: 32px; 
} 

<div class="wrapper"> 
<div class="demo_class"> 
    <canvas id="null" width="32" height="32" style="border:1px solid red;"></canvas> 
</div> 

<div class="demo_class"> 
    <div class="question">1234567890</div> 
</div> 

+0

うまく動作しません。 – aptyp

関連する問題