HTML---CSS字体,文本,背景和边框属性

css字体属性

font-family 规定元素的字体系列
font-size 设置字体的尺寸
font-style 设置字体的风格
font-weight 设置字体的粗细
color 设置字体的颜色

<style type="text/css">
    p{
        /*汉字一般使用宋体,英文一般使用Ari..*/
        font-famliy:"宋体";

        /*相对单位(推荐):px em(2em相当于当前字体的2倍);绝对单位:cm mm*/
        font-size:"30px"

        /*normal:默认值;italic:斜体;oblique:倾斜*/
        font-style:"normal"

        /*normal:默认值;bold:粗体;bolder:更粗的字体;100~900:粗细的范围*/
        font-weight:"normal"

        color:"orange"

    }
</style>

css文本属性

text-indent 首行缩进
text-align 文本对齐 left center right justify(两端对齐)
word-spacing 字间隔
letter-spacing 字符间隔
text-transform 字符转换 none uppercase(大写) lowercase(小写) capitalize(首字母大写)
text-decoration 文本装饰 none underline overline line-through blink(闪烁)
white-space 空白处理 nowrap(强制不换行) normal(默认)

<style type="text/css">
    #a01{
        text-indent:"20px"; /*首行缩进*/
        text-align:"center"; /*文本对齐*/
        word-spacing:"10px"; /*字间隔*/
        letter-spacing"20px"; /字符间隔/
        text-transform:"none"; /*字符装换*/
        text-decoration:"underline"; /*文本装饰*/
        white-space:"normal"; /*处理空白*/
        height:"200px";
        line-height:"200px" ;/*把行高和区域高度一致,就是居中显示*/
    }
a{
    text-decoration:none;/*去掉超链接中的下划线*/
}
</style>

背景属性

background-color 背景颜色
background-image 背景图片
background-repeat 背景重复 repeat(默认) repeat-x(x轴平铺) repeat-y(Y轴平铺) no-repeat(不平铺)
background-position 背景定位
[left center(左中) ,center center(居中)] 相对定位
(横坐标,纵坐标) 绝对定位
background-attachment 背景滚动 fixed(固定) scroll(默认)

<style type="text/css">
    body{
        background-image:url(图片路径); /*背景图片*/
        background-repeat:repeat-x; /*背景重复*/
        background-poison:left center; /*背景定位*/
        background-attachment:scroll; /*背景滚动*/
    }
</style>

边框属性

border-style/color/width 总边框风格/颜色/厚度
border-left-style/color/width 左边框风格/颜色/厚度
border-right-style/color/width 右边框风格/颜色/厚度
border-top-style/color/width 上边框风格/颜色/厚度
border-bottom-style/color/width 下边框风格/颜色/厚度

<style type="text/css">
    p{
        border:1px solid/*实线*/ #aaa
        border-top-style:none
        border-top-width:dotted /*点状边框*/
        border-top-color:#aaa       
    }
</style>
  • 2
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值