HTML网页设计:三、CSS的基本属性

1、文本属性

font-size:字体大小

font-family:字体

color:字体颜色

font-weight:字体加粗

font-style:字体倾斜

text-align:文本水平居中

text- indent:首行缩进

text-decoration:文本修饰

lettter-spacing:字间距

word-spacing:单词间距

line-height:行高

            font-family: 仿宋;
            font-size: 16px;
            color: aquamarine;
            font-weight: bold;
            text-align: center;
            text-indent: 2em;
            text-decoration: none;
            letter-spacing: 2em;
            line-height: 23px;
            /* font-weight: lighter;
            font-weight: bolder;  */
            font-style: italic;
            /* font-style: oblique; */
            /* font-style: inherit; */
            /* font-style: initial; */

2、列表属性

list-style:none 去除列表符号

list-style-image:将图片设置为列表形式

list-style-position:设置列表项标记的放置位置

list-style-style:定义列表符号样式

            list-style: none;
            list-style-image: url(../img/icon.jpg);
            list-style-position: inside;
            list-style-type: square;

3、背景属性

background-color:背景颜色

background-image:背景图片

background-repeat:背景图片的平铺

background-attachment:背景图片的固定

background-position:背景图片的定位

            background-color: violet;
            background-image: url(../img/pic.jpg);
            /*x轴pingpu 
            background-repeat: repeat-x; */
            /* 不平铺
            background-repeat: no-repeat; */
            /*y轴平铺 
            background-repeat: repeat-y; */
            background-repeat: no-repeat;
            background-position: 23px 80px;
            background-position: left center;
            /* background-position: left; */
            /* background-repeat与background-position两者连用x,y轴位置 ,在不平铺的前提下,设置x,y轴位置*/
            /* background-attachment:fixed; */
            

4、浮动属性

float:定义网页中其他文本如何环绕该元素

        .left{
            float: left;
        }
        .right{
            float: right;
        }

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值