English 中文(简体)
textarea scrollbars overflow and hide div border
原标题:

I ve tried this on many browsers ( via browsershots ) and universally the scrollbars overflow and hide the green border.

I don t want overflow: hidden because that clips the scrollbars.

How do I get the scrollbars inside the border, instead of obscuring the border?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<div style="border: 1px solid green; margin: 0pt; padding: 0pt; width: 100%; height: 100px;">
    <div style="margin: 0pt; padding: 0pt; position: relative; float: left; width: 20%; height: 100%;">
        <select style="margin: 0pt; padding: 0pt; width: 100%; height: 100%;" multiple >
        <option></option>
        </select>
    </div>
    <div style="position: relative; float: left; width: 80%; height: 100%;">
        <form style="margin: 0pt; padding: 0pt; width: 100%; height: 100%; display: inline; position: relative;">
            <textarea readonly="readonly" style="margin: 0pt; padding: 0pt; width: 100%; height: 100%; overflow:scroll;" wrap="off" >
            </textarea>
        </form>
    </div>
</div>
</body>
</html>
问题回答

Text area must have rows attribute. Rows assume font size. Font size and rows will overflow the container.





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签