body{background-color:yellow}h1{background-color:#00ff00}h2{background-"> body{background-color:yellow}h1{background-color:#00ff00}h2{background-" />
CSS背景文本字体

CSS背景文本字体

ID:40526708

大小:142.00 KB

页数:21页

时间:2019-08-04

CSS背景文本字体_第1页
CSS背景文本字体_第2页
CSS背景文本字体_第3页
CSS背景文本字体_第4页
CSS背景文本字体_第5页
资源描述:

《CSS背景文本字体》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、CSS背景实例:设置背景颜色:body{background-color:yellow}h1{background-color:#00ff00}h2{background-color:transparent}p{background-color:rgb(250,0,255)}p.no2{background-color:gray;padding:20px;}

这是标题1

这是标题2<

2、/h2>

这是段落

这个段落设置了内边距。

设置文本背景的颜色:span.highlight{background-color:yellow}

这是文本。这是文本。这是文本。这是文本。这是文本。这是文本。这是文本。这是文本。

3、是文本。

设置图像为背景:body{background-image:url(/i/eg_bg_04.gif);}如何重复背景图像:body{background-image:url(/i/eg_bg_03.gif);background-repeat:repea

4、t}如何在垂直方向上重复背景图像:body{background-image:url(/i/eg_bg_03.gif);background-repeat:repeat-y}如何只显示一次背景图像:body{background-image:

5、url('/i/eg_bg_03.gif');background-repeat:no-repeat}如何放置背景图像:body{background-image:url('/i/eg_bg_03.gif');background-repeat:no-repeat;background-attachment:fixed;background-position:center;}<

6、/style>

提示:您需要把background-attachment属性设置为"fixed",才能保证该属性在Firefox和Opera中正常工作。

如何用%来定位背景图像:body{background-image:url('/i/eg_bg_03.gif');background-repeat:no-repeat;background-

7、attachment:fixed;background-position:30%20%;}

注释:为了在Mozilla中实现此效果,background-attachment属性必须设置为"fixed"。

如何用像素来定位背景图像:body{background-image:url('/i/eg_bg_03.gif');background-repeat

8、:no-repeat;background-attachment:fixed;background-position:50px100px;}

注释:为了在Mozilla中实现此效果,background-attachment属性必须设置为"fixed"。

如何设置固定的背景图像:

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。