고정 너비이지만 가변 높이의 HTML 텍스트 영역이 있습니다. overflow:scroll
세로 스크롤 막대 를 설정 하고 표시하고 싶지만 가로 스크롤 막대를 표시하고 싶습니다 . overflow:auto
상황에 맞는 다른 것들로 인해 사용할 수 없습니다 .
CSS2를 사용하여 세로 스크롤 막대는 표시하지 않는 방법이 없다는 것을 알고 있습니다. 가로 스크롤 막대를 숨기기 위해 JavaScript로 할 수있는 작업이 있습니까?
답변
다음과 같이 CSS를 사용할 수 있습니다.
overflow-y: scroll;
overflow-x: hidden;
답변
CSS를 사용하십시오. 자바 스크립트보다 쉽고 빠릅니다.
overflow-x: hidden;
overflow-y: scroll;
답변
이 코드를 추가하여 가로 스크롤 막대를 완전히 비활성화하십시오.
body{
overflow-x: hidden;
overflow-y: scroll;
}
답변
wrap=virtual
HTML 양식 상자에서 사용 하면 상자 하단의 가로 스크롤 막대가 제거됩니다.
<textarea name= "enquiry" rows="4" cols="30" wrap="virtual"></textarea>
여기 예를 참조 하십시오 : http://jsbin.com/opube3/2 (FF 및 IE에서 테스트 됨)
답변
<div style="width:100px;height:100px;overflow-x:hidden;overflow-y:auto;background-color:#000000">
답변
selector{
overflow-y: scroll;
overflow-x: hidden;
}
스 니펫 및 jsfiddle 링크를 사용한 작업 예 https://jsfiddle.net/sx8u82xp/3/
.container{
height:100vh;
overflow-y:scroll;
overflow-x: hidden;
background:yellow;
}
<div class="container">
<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 popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</p>
<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 popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</p>
<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 popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</p>
<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 popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</p>
</div>
답변
.combobox_selector ul {
padding: 0;
margin: 0;
list-style: none;
border:1px solid #CCC;
height: 200px;
overflow: auto;
overflow-x: hidden;
}
200px 스크롤 크기를 설정 overflow-x
하고 가로 스크롤 막대를 숨 깁니다.