CSS常用属性&盒子模型

css属性

    -文字属性:对文字设置样式的属性
        font-size:大小
        font-family:字体
    
    -文本属性:
        color:颜色
        text-decoration:下划线   
            属性值:none 取消下划线   underline下划线  overline上划线
        text-align:对齐方式
            
    -背景属性:
        background-color:背景色
        background-image:背景图
            属性值:url("图片地址")
        background-repeat:平铺方式
            属性值:默认横向纵向平铺
                repeat:横向纵向平铺
                no-repeat:不平埔
                repeat-y;纵向平铺
                repeat-x:横向平铺
            
    -列表属性:
        list-style-type:列表项目前面的小标志
        list-style-image:设置列表项目前的图片
            url("图片地址")
        ul{list-style-image: url("8.png");}
        <ul>
            <li>房间一</li>
            <li>房间一</li>
            <li>房间一</li>
        </ul>
        
    -尺寸属性:
        width:宽度
        height:高度
        
    -显示属性:
        display:
            属性值:
                none 隐藏
                block:块级显示
                inline:行级显示   
        
    -浮动属性:float
        属性值:left  right  clear 清除浮动
        缺点:会影响相邻元素不能正常显示
              会影响父元素不能正常显示
        #d1{background-color: red;width: 100px;height: 100px;float: left;}
        #d2{background-color: blue;width: 100px;height: 100px;float: right;}

盒子模型

        border:
            border-width:边框厚度
            border-color:边框颜色
            border-style:边框样式
            
        border-top:上边框
        border-bottom:下边框
        border-left:左边框
        border-right:右边框
        
        padding:代表边框内壁和内部元素之间的距离
            padding:5px; 表示上下左右都是5px;
            padding:5px 10px 15px 20px; 上右下左
            padding:5px 10px;上下    左右  
            padding-top:单独设置
            
        margin:代表边框外壁和其他元素之间的距离
            margin:5px; 表示上下左右都是5px;
            margin:5px 10px 15px 20px; 上右下左
            margin:5px 10px;上下    左右  
            margin-top:单独设置

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值