Blogger Information
Blog 16
fans 0
comment 0
visits 13244
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
CSS选择器的优先级,提权以及CSS的属性简写
小雨丶
Original
1156 people have browsed it
a链接跟form表单中的样式选取
1.a链接标签四种状态
  1. a:link{//默认,没有点击访问的状态}
  2. a:visited{//已点击访问过得状态}
  3. a:hover{//鼠标悬停状态}
  4. a:active{激活,鼠标点击按下去的状态}
2.表单

先看一个表单:

  1. <form action="">
  2. <p><input type="text" name="" value="admin" readonly></p>
  3. <p><input type="email" name="" value="" required></p>
  4. <p><input type="password" name="" value="123456" disabled></p>
  5. </form>

选取只读的,也就是具有readonly属性的标签:

  1. input:read-only{}

选取邮箱可以用input[type=email]{}//type属性方法,
下面这个是用required属性

  1. input:required{}
选择器的优先级
1.当选择器等级相同时,书写顺序后边的会大于前边的
2.选择器等级不同
  1. 标签tag < 类选择器class < ID选择器
3.级别的提权
  1. [高等级,较高等级,低等级]
  2. 高等级 [Id Id Id,]
  3. 较高等级 [Class Class Class]
  4. 低等级 [Tag Tag Tag,]
  5. 父级 ————————> 子级
  6. 即:在子元素等级相同情况下,
  7. 有无父级 || 父级别元素高的等级高;
  8. 在父元素等级相同情况下,
  9. 子级别元素高的等级高;
CSS中属性的简写
  1. 字体属性:
  2. .title{
  3. font-family: sans-serif;
  4. font-size:24px;
  5. font-style:italic;
  6. font-weight:lighter;
  7. }
  8. 简写:
  9. font:italic lighter 36px sans-serif;
box
  1. 裁剪背景色到内容区:background-clip:content-box;
  2. 左右相等,上下不等
  3. padding:1px 2px 3px;//中间的是左右的值
Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post