簡體   English   中英

如何根據屏幕自動調整高度和寬度?

[英]how can i make height and width auto resize according the screen?

這是我用來在移動應用程序項目中添加滾動文本的代碼。

<style type="text/css">
     .scroll {      
         padding: 10px;      
         height: 280px;
         width: 580px; 
         overflow: scroll;
     }
</style>

<div class="scroll"> 
    <p>put paragraph here</p> 
</div>    `enter code here`

您可以使用以下方法:

<style type="text/css">
     .scroll {      
         padding: 10px;      

         width: 100%; 
         overflow:auto;
        -webkit-overflow-scrolling: touch;
     }
</style>

JSFiddle

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM