我想在html中創建一個具有固定大小的div元素。我的問題是,上面的div接收骨幹輸入文本。文本的大小是未知的,所以每次發送的文本很大時,div的大小自動變化。如何才能顯示適合div的預定義邊界框的文本的第一個單詞?div元素的固定大小
我的CSS代碼
.hashTagsCloud {
max-width: 500px;
max-height: 400px;
overflow: hidden;
}
和HTML代碼:
<div class= "hashTagsCloud span4 offset1 "> //bootstrap
<div id="profiles> //backbone view
<script id="profileTemplate" type="text/template">//backbone template
</script>
</div>
</div>
我拿數據和的getElementById。
您是否在尋找'height','width'和組合['溢出:隱藏;'(https://developer.mozilla.org/en-US/docs/Web/CSS/溢出)? – Sirko