2016-01-01 69 views
-1

我的縮略圖存在問題,我在縮略圖中添加了TEXT標籤,如果TEXT太長,會導致TEXT超過縮略圖寬度。後市展望:<a> ...</a>標籤超出縮略圖寬度

+----------------------------------+ 
| Loremipsumdolorsitamet,consectetu| 
| er        | 
|         | 
+----------------------------------+ 

現實:

 col-md-6 
+----------------------------------+ 
| Loremipsumdolorsitamet,consectetuer 
|         | 
|         | 
+----------------------------------+ 

這是我的代碼:

while() 
{ 
    <div class="col-md-6"> 
     <div class="thumbnail" style="padding-left:10px; padding-top:5px"> 
     <a>Lorem ipsum dolor sit amet, consectetuer</a> 
    </div> 
    </div> 
} 
+0

哪裏是你的代碼...? – MorKadosh

回答

0

看看這個例子:https://jsfiddle.net/ks3r78bu/

HTML:

<div class="img-cont"> 
    <img src="http://placehold.it/350x150" /> 
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p> 
</div> 

CSS:

.img-cont{ 
    width:350px; 
    height:150px; 
} 
.img-cont p{ 
    margin:0px; 
    padding:5px; 
    position:relative; 
    top:-150px; 
    left:0px; 
}