HTML与CSS学习笔记(2)
1、CSS背景样式? background-color 背景色 background-image 背景图 url(背景地址) 默认:会水平垂直铺满背景图 background-repeat 平铺方式 repeat-x x轴平铺 repeat-y y轴平铺 repeat(x和y都进行平铺,默认值) no-repeat 都不平铺 background-position 背景位置 x y 如果为正数:图片就会往右和下进行偏移;如果为负数:图片往左和上进行偏移 还可以用单词: x:left、center、right y:top、center、bottom 还可以是百分数。 background-attachment :背景图随滚动条移动的方式 scroll:默认值,跟着滚动条移动(背景位置是按照当前元素进行偏移的) fixed:固定,不随浏览器滚动条移动(背景位置是按照浏览器进行偏移的) 2、CSS边框样式? border-style:边框样式 solid:实线; dashed:虚线; dotted:点线; border-width:边框大小 px border-color:边框颜色 red、#f00 边框也可以针对某一条边进行单独设置:border-top-style;中间是方向,可以是left、right、top、bottom 颜色:透明颜色 transparent 3、css文字样式