Forum Moderators: not2easy
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Clipped Scrollbar and Border in Webkit</title>
<style>
textarea,
iframe {
display: block;
width: 300px;
margin: 0;
padding: 0;
}
textarea {
height: 200px;
resize: none;
outline: 0;
border: solid red;
border-width: 0 0 5px;
}
iframe {
height: 0;
border: 0;
}
</style>
</head>
<body>
<textarea>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
</textarea>
<iframe srcdoc="<p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>"></iframe>
</body>
</html>
The cause of your problem appears to be...
iframe {
height:0;
border:0;
}
If you don't want it behave oddly, why not just use this instead...
iframe {
display:none;
}
<iframe scrolling="no" srcdoc="..."></iframe>
iframe::-webkit-scrollbar {
display: none;
}
The scrolling attribute on the iframe element is obsolete and I'd prefer to avoid it.
I'm working on a small application in which the user can change the iframe height size.