div css to add a scroll and scroll bar is hidden

 In html

<div class="box">
    <div>下面内容会单独滚动</div>
    <div class="scroll">
        <div class="content">
            <p>1111111111111111</p>
            <p>222222222222222</p>
            <p>333333333333333</p>
            <p>4444444444444444</p>
            <p>1111111111111111</p>
            <p>222222222222222</p>
            <p>333333333333333</p>
            <p>4444444444444444</p>
        </div>
    </div>
</div>

css section 

<style> 
    div { 
        font - size: 15px; 
        margin - bottom: 20px; 
    } 
    .content { 
        height: 300px by; V // need to set the height of the rolling part of 
        background- Color: CadetBlue; 
        Color: AntiqueWhite; 
        overflow the -X-: hidden ; / * X-axis prohibit rolling * / 
             overflow -Y: scroll; / * Y-axis scroll * / 
    } 
    .content :: -webkit- scrollBar { 
        the display: none; / * hide scrollbars * / 
    } 
    P { 
        margin-bottom: 30px;
        font-size: 17px;
        color: #333;
    }
</style>

 

Guess you like

Origin www.cnblogs.com/bluealine/p/11981024.html