[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
1.包含选择器
包含选择器通过空格标识符来实现
例如:
<div id="header"> <p>文本一</p> </div> <div id="main"> <p>文本二</p> </div> #header
p{ fontsize:12px; } #header p{ fontsize:12px; }
即设置header和main里<p>标签像素大小为12
2.子选择器
子选择器是指定父元素所包含的子元素,子选择器使用">"表示
例如:
div>span{ ...... font-size:24px; }
即包含在div元素里的子元素span字体大小都定义为24像素。
3.相邻选择器
相邻选择器通过“+”分隔符定义,即两个标签必须是规定给的顺序关系,否则无法实现
例如:
p+h3{ ...... background-color:#0099FF;}
即在<p>标签之后的一个<h3>标签背景设置为蓝色。
4.兄弟选择器
通过“~”分隔符定义,能够选择前置元素后同级的所有匹配元素
例如:
p~h3{ background-color:#0099FF; .......} <h3>文本一</h3> <p>文本二</p> <h3>文本三</h3>
即<p>之后的所有h3背景色都改为蓝色。
5.分组选择器
分组选择器通过“,”分隔符定义,通过分组选择器可以实现集体声明,将一致的CSS样式放在一起。
例如:
h1,h2,h3{ background-color:#0099FF; .......}
即将h1,h2,h3标签的背景都设置为蓝色。