css2

css
标签上设置style属性
background=color:red;height:20px
编写css样式
1.标签的style属性
2.写在head里面,style属性
#i1{background=color:red;height:20px} id=“i1”
.cl{background=color:red;height:20px} class=“c1”
div{…} div选择器
#i1{…} id=“i1” id选择器
.c1{…} class=“c1” class选择器
优先级:标签上的style优先,然后就近原则
注意:css样式也可以写在单独文件中,引用

3.关联层级选择器(空格) span div{} span下的div段
4.组合选择器(逗号,) span,div,.c1{} 多个选择
5.属性选择器 input[type=“text”]{…}
注释/* */
6边框


asadd

border 边框 solid实线 dotted虚线 颜色red
border-left 左边 top上边
5
height 高度 百分比
weidth 宽度,像素 百分比
text-align:ceter 水平方向居中
line-height:height 垂直方向根据标签高度居住
color 字体颜色
font-size 字体大小
font-weight 字体加粗
6 float
让标签飘起了,快级标签可进行堆叠
style=“clear:both;” 父包子
style=“display:inline;” 变成行内标签
style=“display:block;” 变成块级标签
style="margin: 0 auto; 一行铺满无边界
7 display
display:none; 让标签消失
display:inline;
display:block;
display:inline-block;
具有inline,默认自己有多少占多少
具有block设置高度 宽度 padding margin
行内标签:无法设置高度 宽度 padding margin
块级标签:设置高度 宽度 padding margin
8 paading margin(0,auto)
paading 边距
CSS补充
position:fixed 固定位置
top bottom left right
relative + absolute 相对定位

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值