DEMOの例を参照してください。次の html コードがあります。
helllo hello test test <img src="http://bestsites.me/img/bs.png">
画像がテキストの少し上にあることがわかります。画像を少し下にするにはどうすればよいですか。
これがこれを達成するための最良の方法であるかどうかはわかりませんが、次を使用できます。
helllo hello test test <img src="http://bestsites.me/img/bs.png" style="margin-bottom: -7px;">
または、写真編集ソフトウェア (gimp、vs) で写真を編集することもできます。
HTML:
<p>hello hello test test<img src="image.png"/></p>
CSS:
p,img{
padding:0px;
margin:0px;
}
上記は、 p 要素と image 要素が互いにインラインであることを確認する必要があります。
別の方法:
HTML
<p>Hello Hello test test</p><img src='image.png'/>
CSS
p,img{
padding:0px;
margin:0px;
display:inline-block;//not for ie 5.5-7?
width:49%;
vertical-align:top;
text-align:top;
border:1px solid #FF0000;//to check the positioning of the elements
//these should now be completely level BUT this might not make the text 100% level
}
あなたが使用することができます
<img align='middle'>
真ん中を揃えるとうまくいきます
画像とテキストの位置合わせが機能するはずです。
<img src='src' align='middle'>
画像が真ん中に表示されます