首页前端开发CSSCSS中overflow属性怎么使用

CSS中overflow属性怎么使用

时间2024-05-21 06:42:03发布访客分类CSS浏览24
导读: 我们首先来看一下overflow属性的值有哪些? overflow属性规定当内容溢出元素框时发生的事情。 overflow有以下四个属性值 visible:初始值,内容不会被修剪,会呈现在元素框之外。 scrol...
  我们首先来看一下overflow属性的值有哪些?   overflow属性规定当内容溢出元素框时发生的事情。   overflow有以下四个属性值   visible:初始值,内容不会被修剪,会呈现在元素框之外。   scroll:内容会被修剪,但是浏览器会显示滚动条以便查看其余的内容。   hidden:内容会被修剪,并且其余内容是不可见的。   auto:如果内容被修剪,则浏览器会显示滚动条以便查看其余的内容。   下面我们来详细说一说overflow属性的这四个值   我们来看具体的示例   代码如下   HTML代码                  CSSoverflow               

  TheEuropeanlanguagesaremembersofthesamefamily.Theirseparateexistenceisamyth.Forscience,music,sport,etc,Europeusesthesamevocabulary.Thelanguagesonlydifferintheirgrammar,theirpronunciationandtheirmostcommonwords.Everyonerealizeswhyanewcommonlanguagewouldbedesirable:onecouldrefusetopayexpensivetranslators.   

     
     

  TheEuropeanlanguagesaremembersofthesamefamily.Theirseparateexistenceisamyth.Forscience,music,sport,etc,Europeusesthesamevocabulary.Thelanguagesonlydifferintheirgrammar,theirpronunciationandtheirmostcommonwords.Everyonerealizeswhyanewcommonlanguagewouldbedesirable:onecouldrefusetopayexpensivetranslators.   

     
     

  TheEuropeanlanguagesaremembersofthesamefamily.Theirseparateexistenceisamyth.Forscience,music,sport,etc,Europeusesthesamevocabulary.Thelanguagesonlydifferintheirgrammar,theirpronunciationandtheirmostcommonwords.Everyonerealizeswhyanewcommonlanguagewouldbedesirable:onecouldrefusetopayexpensivetranslators.   

           CSS代码      /*hidden*/   div.hid{   width:200px;   height:100px;   overflow:hidden;   background-color:#FF9999;   }   /*scroll*/   div.scr{   width:200px;   height:100px;   overflow:scroll;   background-color:#99FF99;   }   /*visible*/   div.vis{   width:200px;   height:100px;   overflow:visible;   background-color:#9999FF;   }







本文转载自中文网

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!


若转载请注明出处: CSS中overflow属性怎么使用
本文地址: https://pptw.com/jishu/664694.html
CSS Sprites是什么 CSS如何实现滑动门效果

游客 回复需填写必要信息