博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CSS3 基本语法
阅读量:7306 次
发布时间:2019-06-30

本文共 899 字,大约阅读时间需要 2 分钟。

hot3.png

一,基本语法

//1,css引入方法

    

2,css书写格式

h1,h2{   color:blue;font_size}

二,派生选择器:

        根据元素其位置关系定义上下文样式。

例如:我们只想li中的strong中使其样式改为红色,而p的strong不变。

 

p strong

    
         
  • li strong
  •     

li strong{ color:red;}

 

三,id基础选择器

1,id选择器可以标有id的html页面进行标识。用#来定义。

 
id testttttt

#id1{ color:pink;}

2,id选择器和派生选择器一起使用

id testttttt
www.baidu.com

#id a{ color:blue;}

 

四,类选择器;

以一个点来显示。他也可以作为派生选择器

  
这是class标签啊

//css .pclass{ color:red;}

 

他也可以做派生选择器使用。

 

五,属性选择器:

对带有指定样式的html元素设置样式。

 

shuxingxuanzeqiadafsadf

//css 
     [title]{     color:red;     }    

属性和值选择器。

shuxingxuanzeqiadafsadf

    
shuxingxuanzeqiadafsadf

//css   
     [title]{     color:red;     }     [title="kk"]{     color:blue;     }    

 

 

 

 

 

 

 

 

转载于:https://my.oschina.net/u/2480757/blog/519737

你可能感兴趣的文章
小米松果电子拆分成立大鱼半导体,专注IoT芯片研发
查看>>
技术实践如何支持演进式架构和持续集成
查看>>
学习笔记:call、apply和bind
查看>>
Android单元测试 - 如何开始?
查看>>
zanshi
查看>>
基于Bootstrap做定制,并与官方库保持更新的方法
查看>>
[LintCode/LeetCode] Search in Rotated Sorted Array I & II
查看>>
笔记|缓存
查看>>
[LintCode] Toy Factory
查看>>
信息安全聚合 Sec-News 的重构之路
查看>>
node下的微信之路-1:接口信息配置
查看>>
redis的发布订阅功能
查看>>
RHEL7 Teaming网卡绑定实践
查看>>
设计模式(11)适配器模式(讲解+应用)
查看>>
<jdk7学习笔记>读书笔记-线程
查看>>
特斯拉计划向其他汽车制造商免费开源汽车安全软件
查看>>
使用EMR-Flume同步HDFS audit日志到HDFS
查看>>
k8s与监控--prometheus的远端存储
查看>>
saltstack 从minion传送文件到master及minion文件后端minionfs系统 ...
查看>>
golang使用ssl自签证书通信
查看>>