2009-12-14 92 views
1

我已經在很多瀏覽器上(通過瀏覽器)嘗試了這一點,並且通用滾動條溢出並隱藏了綠色邊框。textarea滾動條溢出並隱藏div邊框

我不想overflow: hidden,因爲那剪輯了滾動條。

如何獲取邊框內的滾動條,而不是模糊邊框?

<!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> 

回答

1

文本區域必須有行屬性。 行假設字體大小。 字體大小和行將溢出容器。