html表边框

时间:2012-02-13 17:09:54

标签: html

我有以下内容:

        <table class="floatleft" style="margin-right:1em;margin-bottom:1em;border:4px;">

虽然桌子周围有边框,但没有边框出现。任何的想法?

2 个答案:

答案 0 :(得分:3)

您已指定border: 4px,其含义与:

相同
border-width: 4px;
border-style: none;
border-color: <the value of the 'color' property>;

...因为unspecified values take their initial value的缩写语法。

明确风格和颜色:

border: 4px solid black;

(或者至少是样式,因为none将阻止任何边框可见)。

答案 1 :(得分:1)

可能是因为你有一个白色背景而你没有设置边框样式和颜色。尝试:

<table class="floatleft" style="margin-right:1em;margin-bottom:1em;border:4px solid red;">
    <tr><td>Hello</td></tr>    
</table>
​

http://jsfiddle.net/karim79/qWLvf/

相关问题