date: 2024-01-30
title: CSS-Introduction
author:
- AllenYGY
status: DONE
tags:
- NOTE
- WEB
- CSS
created: 2024-01-30T00:22
updated: 2024-05-31T01:18
publish: True
CSS-Introduction
Cascading Style Sheets 层叠样式表
CSS世界的诞生就是为图文信息展示服务的
height, weight,...
z-index:1中
的1
,属于<integer>,同时也属于<number>
line-height:1.5中
的1.5
,属于<number>
padding:50%
中的50%
,属于<percent>
99px
#999
transparent
inherit
px, em
百分号%不是长度单位
px
,还有pt, cm, mm, pc
, 几乎不用
相对长度单位
em,ex
还有CSS3中的rem,ch
;vh,vw,vmin,vmax
;rgba和hsla
)url
)calc
)和过渡效果等rgba(0,0,0,.5)
、url('css-world.png')
、attr('href')
和scale(-1)
1px solid rgb(0,0,0)
就可以称为属性值z-index:1
的1
也是属性值。例如:
color: transparent;
例如:
{
height: 99px;
color: transparent;
}
例如:
.vocabulary {
height: 99px;
color: transparent;
}
很多元素可以应用同一个类选择器。
“类”,天生就是被公用的命。
但是,在CSS中,ID样式出现在多个不同的元素上并不会只渲染第一个,而是雨露均沾。但显然不推荐这么做。
如:first-child 或:last-child等。
如::first-line::first-letter、::before和::after。
常见的符号有空格、>、~,还有+等,这些都是非常常用的选择器。
>
连接。适用于IE7以上版本。
~
连接。适用于IE7以上版本。
+
连接。适用于IE7以上版本。
例如: @media、@font-face、@page或者@support,诸如此类。