css當(dāng)中overflow用法

馬克- to-win:馬克 java社區(qū):防盜版實(shí)名手機(jī)尾號(hào): 73203。



例 1.5

<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <style type="text/css">
        div
        {
            background-color:#00FFFF;
            width:100px;
            height:100px;
            overflow: scroll
        }
    </style>
</head>

<body>
<p>如果元素中的內(nèi)容超出了給定的寬度和高度屬性,overflow 屬性可以確定是否顯示滾動(dòng)條等行為。</p>

<div>
    這個(gè)屬性定義溢出元素內(nèi)容區(qū)的內(nèi)容會(huì)如何處理auto|visible|hidden|scroll。如果值為 scroll,即使元素框中可以放下所有內(nèi)容也會(huì)出現(xiàn)滾動(dòng)條。馬克-to-win:auto最好。默認(rèn)值是 visible,怎么都能看見。溢出也能看見。
</div>
</body>

</html>




例 1.5_a

<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <style type="text/css">
        div
        {
            background-color:#00FFFF;
            width:700px;
            height:50px;
            overflow: auto
        }
    </style>
</head>

<body>
<p>如果元素中的內(nèi)容超出了給定的寬度和高度屬性,overflow 屬性可以確定是否顯示滾動(dòng)條等行為。</p>

<div>
    這個(gè)屬性定義溢出元素內(nèi)容區(qū)的內(nèi)容會(huì)如何處理visible|hidden|scroll。如果值為 scroll,不論是否需要,用戶代理都會(huì)提供一種滾動(dòng)機(jī)制。因此,有可能即使元素框中可以放下所有內(nèi)容也會(huì)出現(xiàn)滾動(dòng)條。默認(rèn)值是 visible。
</div>
</body>

</html>