网页制作中使整个网页背景为一个颜色或一张图片的代码怎么写?

来源:百度知道 编辑:UC知道 时间:2024/05/23 15:09:00

设置背景色<body style="background:#CC9999">
</body>

设置背景图片<body style="background-image:url(图片地址)">
</body>

css的用法

设置背景色
body { background:#CC9999; }

若图片 为4.gif
body { background-image: url(4.gif); }

如果想加点效果,在上面{}之间再加上以下内容,1.横向循环,2.纵向循环,3.不循环,背景只出现一次

background-repeat: repeat-x;

background-repeat: repeat-y;

background-repeat: no-repeat;