css-overflow hidden (hidden scroll bar, still can scroll)

Source: Internet
Author: User

The company's system, on the PC side can manage our public number, in the Release module page when there is a preview function, rendering the page on the phone side of the style.

The procedure is very simple, one will be finished, but in the preview content too long when the mobile phone frame will have a scroll bar, affecting the beautiful, so I want to remove it, there is a way personally feel very useful, recorded.

idea : write two div nested together, height is fixed, outside div fixed width and overflow:hidden; The width of the div inside is wider than the outside, preferably the width of the scroll bar, overflow-y: auto;

The initial implementation is:

<!--Phone Preview -<Divclass= "Preview-layer"><Divclass= "PREVIEW-BG"></Div><Divclass= "Preview-phone">
<DivID= "preview-html">
</Div>
</Div></Div>

Combine ideas to modify:

<!--Phone Preview -<Divclass= "Preview-layer"><Divclass= "PREVIEW-BG"></Div><Divclass= "Preview-phone">
<Divclass= "Preview-container"><DivID= "preview-html">
</Div></Div>
</Div></Div>
Div.preview-container{position:Absolute;width:230px;Height:405px;Top:62px; Left:15px;Border:2px solid #000;Border-radius:5px;Outline:None;Background-color:#fff;Overflow:Hidden; }
#preview-html {        width:247px;         height:405px;         overflow-y: auto;    }

The results are as follows:

css-overflow hidden (hidden scroll bar, still can scroll)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.