Set the scroll bar to automatically display the excess part in html

In html pages, we sometimes need to automatically display scroll bars after the content in the div exceeds, we can set it like this:

<div class="classlist">
        <div class="autoScroll">
            <asp:RadioButtonList ID="rblClasses" runat="server" DataTextField="className" DataValueField="classID"
                ForeColor="#FF4040">
            </asp:RadioButtonList>
            <br />
            <asp:ImageButton ID="imgSure" runat="server" ImageUrl="~/images/c_sure.jpg" />
            <asp:ImageButton ID="imgClose" runat="server" ImageUrl="~/images/c_close.jpg" />
        </div>
    </div>

Then, set the style like this:

<style type="text/css">
        .classlist
        {
            width: 300px;
            height: 20px;
        }
        .autoScroll
        {
        	width:300px;
        	height:100px;
            overflow:auto;           
        }
        #rblClasses
        {
            margin-left: 20px;
        }
</style>

After setting, when the content displayed in the radio button exceeds the outermost div, the scroll bar will be automatically displayed, that is, the nested div

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324156543&siteId=291194637