CSS3第5章简答题3

版权声明:@桔橘酱 https://blog.csdn.net/weixin_44100210/article/details/89209587

ps:首先创建一个名为"Andriod"的css文件,并且链接外部样式表.代码如下
div{
width: 598px;
background: -moz-linear-gradient(to bottom,#FFFFED,#ececec);
}

/关于以下我写结构伪类常出错的点,其实后来发现本身代码没问题,但是就是少了"span",导致我一直出错,切记,*

  1. 如果你所写代码是 div tr:nth-child(3){background:
    #073d0b;},那么将会显示父级元素中类型为tr的第三个元素,但是! ! !我们要选中的是span标签里的内容, 所以,后面一定要加上span标签才能选中!

**

2.然后,加入span标签后一定要空格!如果加入后未空格,那么!这个背景颜色也是没效果的!

*/

.one tr:nth-child(3) span{
background: #073d0b;
color: #FFFFED;
}

.one tr:nth-child(4) span{
background: #046d07;
color: #FFFFED;
}

.one tr:nth-child(5) span{
background: #25a4b3;
color: #FFFFED;
}

.one tr:nth-child(6) span{
background: #1a66b3;
color: #FFFFED;
}

.one tr:nth-child(7) span{
background: #003580;
color: #FFFFED;
}

.one tr{
color:#5c9815;
}

.two tr{
color: #f26522;
}

.two tr:nth-child(2) span{
background: #f26522;
color: #FFFFED;
}

.two tr:nth-child(3) span{
background: #c72e35;
color: #FFFFED;
}

.two tr:nth-child(4) span{
background: #f2318f;
color: #FFFFED;
}

.two tr:nth-child(5) span{
background: #b41960;
color: #FFFFED;
}

.two tr:nth-child(6) span{
background: #796bf2;
color: #FFFFED;
}

.two tr:nth-child(7) span{
background: #48238a;
color: #FFFFED;
}

在这里插入图片描述
在这里插入图片描述
ps:今天也要努力,加油.

猜你喜欢

转载自blog.csdn.net/weixin_44100210/article/details/89209587
今日推荐