我有一个带有渐变背景图像的网页。 此页面上有一个表格。 我已将边框设置为 5px 宽度和实心。 我想将这些边框不透明度设置为0%,以便用户看到渐变背景。 这可能吗。 这是我到目前为止的表格。
<div style="margin: 0pt auto; width: 980px;background-color:white;">
<div style="500px;overflow:hidden">
<table style="width: 100%; table-layout: fixed;">
<tbody>
<tr>
<th style="border-bottom:5px solid rgba(255,0,0,.5);"><font color="red">Name</font></th>
<th style="border-bottom:5px solid rgba(255,0,0,.5);"><font color="green">Event</font> </th>
<th style="border-bottom:5px solid rgba(255,0,0,.5);"><font color="blue">Description</font></th>
</tr>
<tr>
<td style="width:150px;border-right:1px solid black;border-bottom:1px solid red;"><? echo $Row['name']; ?></td>
<td style="width:150px;border-right:1px solid black;border-bottom:1px solid green;"><? echo $Row['description']; ?></td>
<td style="width:150px;border-bottom:1px solid blue;"><? echo $Row['detail']; ?></td>
</tr>
</tbody>
</table>
</div>
</div>
我按照之前的建议将颜色更改为 rgba(255,0,0,.05),但它显示了为表格外的分区设置的白色背景。 我想显示表格边框的真实页面背景,这是一个彩色渐变。
这已被标记为重复项,但我没有被告知原始问题在哪里。 使用 rgb 或 rgba 只会更改表格单元格背景的不透明度。 我想显示表格后面的页面背景,这是一个彩色渐变。 如果这是一个重复的问题,请告诉我答案在哪里给出。 谢谢。
使用 rgba: border-bottom:5px solid rgba(255, 0, 0, .5);
第 4 个 nr 越低,它看起来越透明。我的示例显示红色。
找到您想要的颜色的RGB细分(谷歌它)并使用
5px solid rgba(255,0,0,.5)
.5
是阿尔法,即透明度