2.5 背景与超链接

背景

纯色背景background-color

定义页面背景

dody
{
   background-color:red;
}

定义元素背景

div
{
   background-color:#000FFF;
}
P
{
   color:blue;(文字为蓝色,背景为红色)
   background-color:red;
}

图片背景background-image

dody
{
   background-image:url(图片路径);
}

排列background-repeat

background-repeat:取值;
属性值说明
repeat 平铺
repeat-x 平铺X轴
repeat-y 平铺Y轴
no-repeat 单图

图片位置background-position

background-position:像素值 或 关键字;

像素值

background-position:水平距离 垂直距离;

关键字

background-position:关键字 关键字;
属性值说明
top left 左上
top center 中上
top right 右上
left center 中左
center center 居中
right center 中右
bottom left 下左
bottom center 下中
bottom right 下右

背景图片固定

background-attachment:取值;
属性值说明
scroll 可翻动
fixed 无法翻动

超链接

超链接伪类

a:link{未访问时的样式}
a:visited{访问后的样式}
a:hover{访问时的样式}
a:active{鼠标点击时的样式}

鼠标样式cursor

cursor:取值;
属性值说明
default 鼠标(默认值)
pointer 手指标
text 输入标
posted @ 2021-12-11 09:27  始墨......至隐  阅读(69)  评论(0)    收藏  举报