CSS를 읽는 동안 샘플 페이지를 작성했습니다. 하지만 내 의 콘텐츠 중 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
의 내용은 크롬의 inspect 요소를 통해 확인하면 body
밖에 있습니다.
변경되었습니다. 감사. div 오버플로에 대해 어떻게해야합니까? –
원하는 전망은 무엇입니까? – theblindprophet
절대 위치 지정을 사용하여 모든 요소로 코딩하는 이유는 무엇입니까? 정적 위치 지정을 사용하는 것이 좋습니다. 이미 절대 위치 지정이 필요한 경우에이 요소에 너비를 사용하십시오. – Lucian