blob: a469ad93e58c9fcc1d6fc761a9c98bbe82280b30 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style>
body {
font: 16px/1.25 monospace;
}
.first-box {
border: 1px solid blue;
}
.second-box {
margin: auto;
border: 1px solid green;
overflow:hidden;
width:75%;
position:relative;
z-index:0;
padding-bottom:20px;
}
#region1, #region2, #region3 {
border: 1px solid black;
}
#region1 {
width: 200px;
height: 100px;
}
#region2 {
width: 300px;
height: 180px;
}
#region3 {
width: 120px;
height: 120px;
}
</style>
</head>
<body>
<p>The first and last lines of text in the regions below should be clipped to the green box. The overflow
section sizes itself and clips differently in each region.</p>
<div id="container">
<div id="region1" style="overflow: hidden;">
<div class="first-box" style="margin-top: 5px; margin-left: 5px; margin-right: 5px;">
<div class="second-box">
<div style="width:500px; opacity:0.8">Clipped line o</div>
<p>These lines will not spill</p>
</div>
</div>
</div>
<div id="region2" style="overflow: hidden;">
<div class="first-box" style="border-top: none; margin-left: 5px; margin-right: 5px;">
<div class="second-box" style="border-top: none;">
<p style="margin-top: 0px;">
out of the regions. These lines will not spill out of the regions.
These lines will not spill out of the regions. These lines will not spill out of the regions.
These lines will not
</p>
</div>
</div>
</div>
<div id="region3">
<div class="first-box" style="border-top: none; margin-left: 5px; margin-right: 5px;">
<div class="second-box" style="border-top: none;">
<p style="margin-top: 0px;">spill out of the regions.</p>
<div style="width:500px; position: absolute;">Clipped </div>
</div>
</div>
</div>
</div>
</body>
</html>