2014-02-24 60 views
1

我環視了一下電路板,找不到任何對我有用的東西,但基本上當我將一個帶有錨標記的圖像居中時,可鏈接區域填滿以適合整個div的寬度,即使指定寬度。我怎樣才能讓鏈接只在圖片周圍?鏈接比圖片大

鏈接到JS小提琴http://jsfiddle.net/jJ4hv/

HTML

 <div id="right"> 

     <div id="content"> 

      <div class="title"> 
       <h3>Spawn</h3> 
       <a href="index.html"><p>&lt;&lt; Go Back</p></a> 
      </div> 

      <a href="images/spawn.png" data-lightbox="inks" title="Spawn"><img src="images/spawnThumb.png" /></a> 
      <p class="description">Spawn</p> 

     </div><!-- END content --> 

    </div><!-- END right --> 

CSS

#content img { 
    display: block; 
    margin: 0 auto; 
    width: 400px; 
} 

.title { 
    border-bottom: thin solid #316b9c; 
    margin-bottom: 20px; 
} 

.title a { 
    font-size: 12px; 
    color: #bcbdbf; 
} 

.title a:hover { 
    color: #316b9c; 
} 

.title a:active { 
    color: #000; 
} 

.topImage { 
    margin-bottom: 10px; 
} 

p { 
    color: #bcbdbf; 
} 
+0

除了源,請包括一個的jsfiddle一個鏈接或東西,有它重建一個例子。 – tuespetre

+0

在OP – Bucthree

+0

更新爲什麼這麼多的投票沒有解釋爲什麼? – Bucthree

回答

0

你可能申請

display: table; 
margin: auto 

周圍的圖像[A]標籤。