100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > html文本的背景 HTML---CSS字体 文本 背景和边框属性

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

时间:2023-11-25 09:11:12

相关推荐

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

css字体属性

font-family 规定元素的字体系列

font-size 设置字体的尺寸

font-style 设置字体的风格

font-weight 设置字体的粗细

color 设置字体的颜色

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"

}

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(默认)

#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;/*去掉超链接中的下划线*/

}

背景属性

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(默认)

body{

background-image:url(图片路径); /*背景图片*/

background-repeat:repeat-x; /*背景重复*/

background-poison:left center; /*背景定位*/

background-attachment:scroll; /*背景滚动*/

}

边框属性

border-style/color/width 总边框风格/颜色/厚度

border-left-style/color/width 左边框风格/颜色/厚度

border-right-style/color/width 右边框风格/颜色/厚度

border-top-style/color/width 上边框风格/颜色/厚度

border-bottom-style/color/width 下边框风格/颜色/厚度

p{

border:1px solid/*实线*/ #aaa

border-top-style:none

border-top-width:dotted /*点状边框*/

border-top-color:#aaa

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。