Я написал образец страницы во время изучения css. Но я обнаружил, что 2 из моих div
s переполнены body
и footer
выше этого div
.Содержимое переполненного тела в html/css
body {
background-color: white;
}
#div1 {
margin: 50px;
text-align: justify;
width: 40%;
position: absolute;
left: 150px;
top: 400px;
}
#div2 {
margin: 50px;
width: 35%;
position: absolute;
left: 800px;
top: 400px;
}
#div3 {
position: relative;
width: 100%;
height: 200px;
top: 500px;
background-color: black;
color: white;
}
footer {
background-color: black;
color: white;
width: 100%;
position: absolute;
bottom: 0;
overflow: hidden;
}
<div id="div1">
<p>
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
</p>
<h1 id="head2"><b>What I can help you with:</b></h1>
<p>
If you’re a company or an agency that cares about creating great user experiences and are looking for someone to help you build a fast, accessible and standards-compliant responsive web site or application, I can help
</p>
</div>
<div id="div2">
<h3>TESTIMONIAL</h3>
<p>
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 galle
</p>
</div>
<footer>
<div id="left">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ip</div>
</footer>
Проблема заключается в том, что div2
и div3
переполнена за footer
и вся страница становится уродливым. Содержимое этих div
s находится за пределами body
, когда я проверяю элемент контроля в хроме.
изменил это. Благодарю. Что делать при переполнении div? –
Каков твой желаемый прогноз? – theblindprophet
Почему вы кодируете все элементы с абсолютным позиционированием? Я рекомендую использовать статическое позиционирование. на всякий случай, если вам уже требуется абсолютное позиционирование, попробуйте использовать ширину этого элемента. – Lucian