我想讓我的小文字更接近我的大文字?我該怎么做呢?
一些關閉我的 HTML
<div class="header">
<br>
<br>
<br>
<br>
<h1>Summit</h1>
<p>Climb the summit, then simply sum it</p>
</div>
我的一些 CSS
.header h1 {
font-family: 'Baloo 2', cursive;
Font-size: 70px;
color: #22223b;
margin-top: 300px;
padding-left: 60px;
}
.header p {
font-family: 'Baloo 2', cursive;
Font-size: 20px;
color: #22223b;
padding-left: 60px;
padding-top: 0px;
margin-top: 0px;
}
謝謝!
uj5u.com熱心網友回復:
HTML 中的每個元素都有自己的邊距和邊框。標題元素通常margin-bottom定義了它們的CSS。
所以你有兩種方法來做到這一點:要么你可以修改<h1> margin-bottom值。或者您可以給出<p>負的 martin-top 值。
選項1:
.header h1 {
margin-bottom: 0;
}
選項 2:
.header p {
margin-top: -5px;
}
uj5u.com熱心網友回復:
大概小文本是段落,大文本是 h1 但你沒有指定多近......調整邊距和填充通常是一個好的開始。
您可以使用單個定義來定義填充和邊距 - 但提供 4 個值(頂部、右側、底部、左側)
.header h1 {
font-family: 'Baloo 2', cursive;
Font-size: 70px;
color: #22223b;
margin: 300px 0 0 0;
padding: 0 0 0 60px;
}
.header p {
font-family: 'Baloo 2', cursive;
Font-size: 20px;
color: #22223b;
padding: 0 0 0 60px;
margin: -1.5rem 0 0 0;
}
<div class="header">
<h1>Summit</h1>
<p>Climb the summit, then simply sum it</p>
</div>
uj5u.com熱心網友回復:
在 HTML 中,<h1>標簽默認提供邊距。所以,你可以在 CSS 中修改它。
喜歡,
header h1{
margin: 0;
}
如果你想具體,你可以使用margin-bottom: 0;代替邊距。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/355101.html
上一篇:如何將非常具體的影像設定為邊框
