html表格中的颜色混合 [英] color mix in a html table

查看:187
本文介绍了html表格中的颜色混合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何在表格中混合两种颜色,例如顶部红色和底部黄色

How we mix two color in a table for example from top red and from bottom yellow

推荐答案

我怀疑您逐行使用CSS来指定每个颜色.或者,您可以制作一个像素宽的位图,并将其平铺为背景.不支持渐变的HTML.
I suspect you use CSS on a row by row basis to specify the color for each. Or you do a bitmap, one pixel wide, and tile it as a background. There is no HTML support for gradients.


使用CSS设置表格样式.
使用背景颜色"属性,并将不同的颜色分配给不同的行.
就像这样:
< table>
< tr>
< td class ="tdRed">& nbsp;& nbsp;& nbsp;& nbsp;</td>
</tr>
< tr>
< td class ="tdYellow">& nbsp;& nbsp;& nbsp;& nbsp;</td>
</tr>
</table>

CSS将是:
.tdRed
{
背景色:红色;
}

.tdYellow
{
背景颜色:黄色;
}

PS:我特意选中了忽略HTML n文本",以便您可以看到"nbsp"内容.
Use CSS to style your table.
Use "background-color" property and assign different colors to different rows.
So something like:
<table>
<tr>
<td class="tdRed">&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
<tr>
<td class="tdYellow">&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>

The CSS will be:
.tdRed
{
background-color:Red;
}

.tdYellow
{
background-color:Yellow;
}

PS: I have intentionally checked ''Ignore HTML n text'' so that you can see the ''nbsp'' thing.


另一种选择是创建颜色渐变并将其用作图片.

[
Another option is to create a colour gradient and use it as an image.

This[^] is an option.


这篇关于html表格中的颜色混合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆