0
使用Twitter的引導,我有以下CSS一個div:如何接受溢出,並有一個默認的高度
#notecard.hero-unit
{
background-image: url("../img/notecard.jpg");
background-size: cover;
width: 60%;
margin-left: 20%;
margin-right: 20%;
height: 1%;
position: relative;
text-align: center;
overflow: hidden;
}
內該div我有文字h2
的變化量與下面的CSS:
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
font-weight: bold;
color: #333333;
text-rendering: optimizelegibility;
}
在#notecard.hero-unit
我使用overflow: hidden;
和height: 1%
因爲大多數時間從h2
卷軸進一步比#notecard
文 - 這樣的工作正在處理和#notecard
現在擴展到h2
的文本內。
但是,當h2
只有一行或兩行時,#notecard
是非常小的。我想#notecard
是一個默認大小 - 比如說300px
,如果有的話仍然接受溢出。
我試圖在h2
到300px
在#noteard
設置高度也高,但都忽略了我所需要的溢出。
謝謝。
也許我太累了,但我不知道目標是什麼。爲什麼不在#notecard上放一個最小高度並在一天內打電話呢? http://jsfiddle.net/M9bX8 – isherwood
我很想責怪自己太累了,還有酒,但不幸的是我在設計上很糟糕。最小高度是我需要的。想提交答案,我會接受嗎?謝謝! –
樂意提供幫助。我們都去過那裏。 – isherwood