css的isibility和overflow

來源:互聯網
上載者:User

標籤:blog   body   code   物理   flow   doctype   pre   display   har   

visibility 

  -1.設定是否顯示對象。與display:none不同,此屬性為隱藏的對象保留其佔據的物理空間

  -2.如果希望對象為可視,其父物件也必須為可視的。

  -3.屬性值:

      -visible:設定對象可視

      -hidden:設定對象隱藏

<!DOCTYPE html><html><head lang="en">    <meta charset="UTF-8">    <title></title>    <style>        .content{            width: 100px;            height: 100px;            background-color: aqua;            visibility: visible;        }        .container{            width: 200px;            height: 200px;            background-color: bisque;            visibility: hidden;        }    </style></head><body>    <div class="container">        <div class="content">            hello        </div>    </div></body></html>

 

overflow

  -1.複合屬性,設定對象處理溢出內容的方式。效果等同於overflow-x + overflow-y

  -2.如果希望對象為可視,其父物件必須也為可視

  -3.屬性值:

      visible:對溢出內容不處理,內容可能會超出容器(預設)

      hidden:隱藏溢出容器的內容且不會出現捲軸

      scroll:隱藏溢出容器的內容,溢出的內容將會以捲軸的方式呈現

      auto:當內容沒有溢出容器時不出現捲軸,當內容出現溢出時,出現捲軸,按需出現捲軸。

        此為body對象和textarea的預設值。

<!DOCTYPE html><html><head lang="en">    <meta charset="UTF-8">    <title></title>    <style>        .content{            width: 200px;            height: 100px;            background-color: pink;            overflow: auto;        }    </style></head><body>    <div class="content">        大家好    </div></body></html>

 

css的isibility和overflow

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.