0722css

css 重叠样式表

color: red;background: “green”
颜色的设置

color: red;
color:#ff00ff; RGB #f0f
color:rgba(255,0,0,0.5);

优先级
选择范围(范围大优先级小)
加载顺序(后加载的优先级大)
特定优先级(color:red !important;)
用法
(1)行内使用(当前标签生效,优先级高)

<a href="#" style="color: red;background: green">合法性</a>

(2)页内使用

<style type = "text/css">
a{
color:rgba(255,0,0,0.5);
}
</style>

(3)页外使用(选择器写入文件)

<link href="a.css" rel="stylesheet">
支持浏览器缓存

选择器
a{ } 标签选择器
#a{ } id选择器 id属性值 (页面内唯一)
.aa{ } 类选择器 class属性值 (可设置多个 class=“aaa back”)
[aaa=‘a1’] 属性选择器 aaa=“a1” (如果属性值为数字或中文时必须加单引号)
a,div{ } 或选择 a或div都有效
div a{ } 归属(子代)选择器 (div标签内的全部a标签)
div >a{ } 归属(子代)选择器 (div标签内的直接子标签,a标签)
:hover 伪类 (标签状态选择器)
box模型+定位
margin 外边距(微调位置,占用原位置)
border 边框(颜色,样式,粗细)
padding 内边距 (内容位置改变,大小改变)
position+left+right+bottom+top 定位
position:fixed; 超级绝对定位(忽略级层,按文档左上角定位,独立一层)
position:absolute; 绝对定位 (按上级容器左上角定位,上级容器也为绝对定位.)
position:relative; 相对定位 (按原位置-未设置定位,来进行定位)
常用属性
display 显示模式 (none,block,inline)
visibility:hidden; 看不见隐藏,占着位置
float 对齐定位
cursor:help; 游标
outline:none;录入焦点边框
z-index:30; 标签重叠优先级
overflow:scroll; 超出范围的方案
简单的css3
css3 效果生成器
额外框架及使用

  <link href = "animate.css" rel = "stylesheet">
  <div class="animated bouncelnUp"> </div>
  <link href="buttons.css" rel="stylesheet">
  <div class="button button-raised button-action button-caution"></civ>
  fonts

css脚本放在head里,网络缓慢时,不显示
css脚本放在body里,网络缓慢时,已加载的显示出来,未加载的不显示

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值