テキストと画像の間にスペースを入れる方法を考えています。私は単語の間隔、詰め物を含め、これまでに学んだことをすべて試しました。href要素内のimgとtextの間のスペースを増やします(単語の間隔?padding?)
あなたが私が達成したいことをよりよく理解できるように、あなたの写真を見せてください。 イメージとテキストの間のスペースを増やしたいと考えています。黄色で強調表示されます。 このサンプルコードを使用してどのように達成できますか? Link to CodePen
HTML
<div class="navbar-header">
<div class="container">
<div id="logo">
<a href="#">
Amazing <img src="http://www.clipartkid.com/images/650/image-spiderman-logo-png-spider-man-wiki-wikia-hYo1XM-clipart.png"/> Spiderman
</a>
</div>
</div>
</div>
CSS
.navbar-header {
border-bottom: 1px solid black;
height: 70px;
margin-bottom: 0;
position: fixed;
width: 100%;
z-index: 100;
}
.container {
align-items: center;
display: flex;
flex-direction: row;
height: 100%;
width: 100%;
}
#logo {
align-items: center;
margin: auto;
}
#logo a {
align-items: center;
color: black;
display: flex;
flex-grow: 2;
margin: auto;
text-decoration: none;
word-spacing: 200px;
}
#logo img {
height: 66px;
margin: auto;
}
画像の前後にスペースを入れてみましたか? を試したことがありますか?ありがとうございます。 –
いいえ、聞いたことがありません。しかし、私はそれが動作して参照してください。私はスペースの幅をワードスペースでコントロールすることができます。 – xeho91