2013-05-27 38 views
0

我有一個css表,看起來完全一樣我喜歡它,但最後一行有200px而不是214px的高度,但我不知道這是從哪裏來的。所有使用的圖像高度爲200像素,CSS也使用該數字。「鬼」14px出現在任何瀏覽器呈現時,無法找出原因

這是它looks like和代碼是這樣的:

CSS:

.table{display: table;width:800px;margin: 0 auto;} 

.table img{border: none;} 

.row{display: table-row;} 

.col{display: table-column;} 

.cell{display: table-cell;} 

#kioskos{background-image: url('../img/thumbnails/kioskosnet.jpg');display:block;width: 250px;height: 200px;} 
#kioskos:hover{background: url('../img/hovers/kioskos_h.png');} 

HTML:

<div class="row"> 
          <div class="cell"><a id="kioskos" class="fancybox" rel="group" data-title="'Kioskos.net' Company's main website design. First 
approach to web design." href="assets/img/fotos_grandes/kioskosnet1.jpg"></a></div> 
         </div> 

回答

0

這是因爲您的最後一個單元格中有一個&nbsp;,這是您的圖像下面的位置。 刪除它或使用

.cell { 
    display: table-cell; 
    vertical-align: top; 
} 
+0

謝謝!這固定了它。 – Tsundoku

0

可以請你發佈一個鏈接到原始網站?

根據您提供的信息,我可以判斷圖像是垂直「居中」的,因爲「額外」px來自表格的頂部和底部。

相關問題