その場合、このような記述になります。
<div style=
"line-height: 0em; /*行間の高さ*/
margin-top: 0px; /*文字上マージン*/
margin-bottom: 0px; /*文字下マージン*/
background: rgb(0, 0, 0);/*背景色*/
border-radius: 10px; /*枠の角丸め*/
border: 2px dotted rgb(17, 17, 17);/*枠線色*/
color: white; /*文字色*/
display: inline-block;/*枠の幅を文字列の長さにする*/
padding: 10px;/*字送りの間隔*/
">
<p>
サンプル
</p>
</div>
<p>と</p>の間に記載された内容が実際に画面上に表示されます。
以前、文章の中に枠囲いがしたくなったときに、一度ご紹介させていただきましたが、今回は、枠内の行間を詰めたかったので。調べたところ「div style」の中に
"line-height: 0em; /*行間の高さ*/
margin-top: 0px; /*文字上マージン*/
margin-bottom: 0px; /*文字下マージン*/
と記述すれば、行間の幅等も変更可能である、ということがわかりました。
参考記事
https://hensa40.cutegirl.jp/archives/3556
0 件のコメント:
コメントを投稿