css實現div自適應與文字超出換行


html,body{
height:100%; //關鍵
}

/*包裹其他所有div的div*/

#cover {
width:100%; //關鍵
height:auto;  //關鍵
border-radius: 10px;
background-size:100% auto;
background-repeat:no-repeat;
background-image: url('<%=basePath%>img/bg.jpg');
-webkit-background-size: cover;
-moz-background-size:cover;
-o-background-size: cover;
}

 

 

//其他內部div均設置為height:auto:從而實現自適應

 

文字自動換行:

word-break:break-all;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM