打印

关于CSS的两个疑问,路过知道的帮我解决下,谢谢!

1、假如我是重定向了标签样式,譬如tr,怎样才能让它在我指定的表格上使用,而其它表格仍旧为默认不变的。是否是在定义时加 tr.mycss {} ,这样写,但好像没用啊!

2、还是tr的问题,有个表格,隔行颜色不同,那我可以用以下方法实现:
复制内容到剪贴板
代码:
tr {
    background-color: expression((this.sectionRowIndex%2==0) ? "#FFF0F0" : "#F0F0FF");
}
问题是如何让它第一行为其它颜色,这样写这个表达式(因为CSS的语法不熟悉,判断表达式不知道如何写)

我的代码如下:

 提示:您可以先修改部分代码再运行


 提示:您可以先修改部分代码再运行
我向往我美丽的梦,但是美丽的太遥远。。。
求职,有意者请联系。。。
谢谢,谢谢!
第二个问哪位好心人帮我解决下!
#FFF0F0和#F0F0FF
就是颜色的16进制值,改它们就好了.
我向往我美丽的梦,但是美丽的太遥远。。。
求职,有意者请联系。。。

TOP

还在为头像烦恼?还在为不能关注好友动态烦忧?快来蓝色理想家园吧!
不是两个颜色
我的意思是,表格的第一行作为表头!显示的是其它颜色!

我本想这样写:
复制内容到剪贴板
代码:
tr {
    background-color: expression((this.sectionRowIndex>0) ? ((this.sectionRowIndex%2==0) ? "#FFF0F0" : "#F0F0FF") : "#aaaaaa");
}
我知道写法肯定有错,就是想表达这个意思,无奈CSS的语法不通!555

TOP



 提示:您可以先修改部分代码再运行

TOP

答问题2:

 提示:您可以先修改部分代码再运行

TOP

谢谢,谢谢,万分感谢!

TOP

关注中

TOP

olddig很有创意啊

TOP

见识了,,,
this.sectionRowIndex==0?"#AFAFAF"(this.sectionRowIndex%2==0) ? "#FFF0F0" : "#F0F0FF"));

这是JS里用的吗?没见过,,呵,,
http://www.tochgo.com
cn=1元

TOP

还能玩出很多花样,在这里再次感谢热心的朋友!
看看我的应用:
复制内容到剪贴板
代码:
<style type="text/css">
<!--
#DataGrid1 tr {
    background-color: expression(
        this.sectionRowIndex == 0 ? "#FFCCCC" :
        (
            (this.sectionRowIndex % 2 == 0) ? "#FFF0F0" : "#F0F0FF"
        )
    );
    color: expression(this.sectionRowIndex == 0 ? "#FFFFFF" : "");
    font-weight: expression(this.sectionRowIndex == 0 ? "BOLD" : "");
    TableSelect: expression(
        this.sectionRowIndex == 0 ? "" :
        (
            onmouseover = function()
            {
                this.style.backgroundColor =
                (
                    this.style.backgroundColor != "#69cdff" ? "#69cdff" :
                    (
                        this.sectionRowIndex == 0 ? "#FFCCCC" :
                        (
                            this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
                        )
                    )
                )
            },
            onmouseout = function()
            {
                this.style.backgroundColor =
                (
                    this.style.backgroundColor != "#69cdff" ? "#69cdff" :
                    (
                        this.sectionRowIndex == 0 ? "#FFCCCC" :
                        (
                            this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
                        )
                    )
                )
            }
        )
    )
}
#DataGrid1 td {
    background-color:expression(
        this.cellIndex == 0 ?
        (
            this.parentElement.sectionRowIndex == 0 ? "#FFCCCC" : "#DDDDDD"
        )
        : null
    )
}
.FindAreaTable {
    font-size: 12px;
    color: #333333;
    text-decoration: none;
    width: 1024px;
    cursor: hand;
    background-color: #FFFFFF;
    vertical-align: middle;
    text-align: center;
}
-->
</style>
代码如下:

 提示:您可以先修改部分代码再运行

TOP

强,见识了