我想,當你將鼠標懸停DIV article_head做,檢查跨度寬度,如果是更大然後420PX(parrent DIV寬度 - article_head)移動文本看到它的整體。我知道,這有點複雜......懸停移動文本,如果寬度> 420
例子:
現在,當你將鼠標懸停 「如何安裝Windows ...」 它會移動文字並顯示
<div class="article_head"><span>Text with bigger width than 420px</span></div>
.article_head span{
font-size: 40px;
font-weight: 300;
line-height: 110% !important;
text-transform: none !important;
white-space:nowrap;
}
.article_head{
line-height: 110% !important;
margin:-10px 0 10px;
height: 50px;
overflow: hidden;
width:420px
}
我試過幾次,但都沒有成功...
@ZachSaucier我試圖在js中做一些事情,但span寬度總是等於父寬度,並且它永遠不會比父寬度大。所以當我寫寬度大於420時,它永遠不會是真的,因爲跨度寬度總是等於420px,並且不會改變。 –