對不起,如果這是一個重複的問題,但我找不到與此有效的完全匹配,所以在這裏。div沒有調整內容大小
我有一個網頁與每個數據庫條目divs。但是,div不會用文本調整大小,導致文本顯示在div外。我正在使用bootstrap。我已附加fiddle。 增加小提琴輸出的寬度以查看溢出文字。
目前,我只是在桌面版上工作,但我也必須構建移動版。所以它會更好,如果你能幫助我既:)
下面是我的代碼
.each-entry-box {
min-height: 80px;
max-height: 110px;
width: 80%;
background: #F5F5F5;
margin: 10px;
border-radius: 5px;
position: relative;
}
.each-entry-box-header {
height: auto;
width: 100%;
background: #E6E6FA;
margin: 0;
border-radius: 5px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
position: absolute;
padding: 2px;
}
.main-content {
margin: 15px;
top: 30px;
position: relative;
width: 100%;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" rel="stylesheet"/>
<div class="each-entry-box">
<div class="each-entry-box-header">
<div class="col-md-9 customer-name">
<i class="glyphicon glyphicon-user glyphicon-class"></i><span>customer name</span>
</div>
<div class="col-md-3 added-on">
<i class="glyphicon glyphicon-time glyphicon-class"></i><span>time</span>
</div>
</div> <!-- each-entry-box-header ends here -->
<div class="main-content">
<div class="col-md-12">
<div class="col-md-3 customer-mobile">
<i class="glyphicon glyphicon-earphone glyphicon-class"></i><span>mobile number</span>
</div>
<div class="col-md-9 customer-email">
<i class="glyphicon glyphicon-envelope glyphicon-class"></i><span>No email ID added</span>
</div>
</div>
<div class="col-md-12">
Material : None
</div>
<div class="col-md-12">
<div class="col-md-4">
XYZ : None
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
</div>
</div>
</div>
</div>
這裏是[內部格可調整大小的文本(http://stackoverflow.com/questions/6112660/how-to-automatically-change-the-text-size -side-a-div)解決方案從StackOverflow本身。 –
從'.each-entry-box'刪除'max-height' – Rohit
@Subham,我的問題與此完全相反。當我的文本溢出時,我希望我的div增加高度 – mrid