2011-11-18 106 views
1

我有我的CSS的問題...有一個邊框,即使它有邊框我無法擺脫:0px;!這真的很煩人。我以前有同樣的問題,但我解決它在某種程度上使我有相同的代碼,但沒有成功嘗試了......如何擺脫邊框

HTML/PHP代碼:

echo "<table class='profileinfo' cellpadding='5' cellspacing='0' border='0'>";     
// Check Map 
$map1 = "Summoner's Rift"; 
$map2 = "Twisted Treeline"; 
$map3 = "Crystal Scar"; 
echo "<tr>"; 
if ($row['map'] == $map1) { echo "<td rowspan='10' class='imageframe155pxblue'><div style='background-image:url(images/tournament/SummonersRift.png);'><div></div></div></td>"; } 
else if ($row['map'] == $map2) { echo "<td rowspan='10' class='imageframe155pxblue'><div style='background-image:url(images/tournament/TwistedTreeline.png);'><div></div></div></td>"; } 
else { echo "<td rowspan='10' class='imageframe155pxblue'><div style='background-image:url(images/tournament/CrystalScar.png);'><div></div></div></td>"; } 
echo "</tr>"; 

CSS代碼:

.profileinfo tr td { 
    border-top: solid 1px #000; 
    border-left: solid 1px #000; 
} 
.imageframe155pxblue { 
    border:none; 
} 
.imageframe155pxblue div { 
    background-repeat:no-repeat; 
    background-position:center; 
    width:155px; 
    height:155px; 
} 
.imageframe155pxblue div div { 
    background-image:url(../images/imageframes/blue.png); 
    width:155px; 
    height:155px; 
} 

如果我刪除了左邊框和.profileinfo -TOP,但它必須是有它的工作原理...

+0

邊框在哪裏顯示? –

+0

爲什麼你不給邊框與包含div的背景顏色相同的顏色? – Pateman

+2

Firefox有一個很酷的補充說,使用稱爲螢火蟲。這有一個漂亮的功能,您可以突出顯示和元素,並在佈局選項卡下顯示邊距/邊框/填充和大小 - 以便您可以輕鬆查看要更改的內容https://addons.mozilla.org/en-US/firefox/ addon/firebug/ –

回答

0

嘗試

.imageframe155pxblue { 
    border:none !important; 
} 
+0

Thanks1它解決了我的問題! – ZyteX

3

顯示邊框是因爲「.profileinfo tr td」是比「.imageframe155pxblue」更具體的規則,並且它聲明瞭邊框。

將您的規則更改爲「.profileinfo tr td.imageframe155pxblue」,邊框將消失,或將!important添加到它的聲明中。