テキストが中央の段落と一番上にあるように、移動を試みましたが、余白を追加するたびにサイズが大きくなります背景画像。私は他のプロパティを使用する場合、それはテキストを移動しません、助けてください、ありがとう!画像のサイズを大きくしないでテキストを移動する方法
* {
box-sizing: border-box;
}
body {
margin: 0;
text-align: center;
font-family: Elephant, sans-serif;
}
img {
max-width: 100%;
}
a {
text-decoration: none;
}
/* ====== About ====== */
#about {
max-width: 100%;
background-size: cover;
background-position: center;
background-image: url(https://i.imgur.com/zpwqaEG.jpg);
padding: 350px 0;
}
.aboutHead {
display: inline-block;
font-size: 64px;
font-style: italic;
color: #fff;
border-bottom: 2px solid #993b3b;
}
<section id="about">
<h1 class="aboutHead">Our Focus</h1>
<p class="about1">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
<p class="about2">
Nullam ultrices euismod suscipit. Integer vitae massa quam.
Maecenas tristique vitae mi sit amet rutrum.
Etiam fringilla justo vitae felis tempus volutpat.
Phasellus urna ante, porttitor iaculis mattis id, suscipit ul
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
</section>
これは動作しませんでした! – user8190367
これは達成したいことですか? https://codepen.io/anon/pen/zPYyZa – bnayagrawal
これは実際に働いて、私はテストしたし、それはなぜidkを動作させるが、それを試してみたときに仕事をしなかった – user8190367