﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-追求编程之美-随笔分类-css学习</title><link>http://www.blogjava.net/zwyan2009/category/42351.html</link><description>先做人，再做技术人员，最后做程序员。 
</description><language>zh-cn</language><lastBuildDate>Sun, 25 Oct 2009 10:09:18 GMT</lastBuildDate><pubDate>Sun, 25 Oct 2009 10:09:18 GMT</pubDate><ttl>60</ttl><item><title>css学习之背景</title><link>http://www.blogjava.net/zwyan2009/archive/2009/10/25/299676.html</link><dc:creator>yanZhangWu</dc:creator><author>yanZhangWu</author><pubDate>Sun, 25 Oct 2009 09:17:00 GMT</pubDate><guid>http://www.blogjava.net/zwyan2009/archive/2009/10/25/299676.html</guid><wfw:comment>http://www.blogjava.net/zwyan2009/comments/299676.html</wfw:comment><comments>http://www.blogjava.net/zwyan2009/archive/2009/10/25/299676.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zwyan2009/comments/commentRss/299676.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zwyan2009/services/trackbacks/299676.html</trackback:ping><description><![CDATA[<span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; ">
<p style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 18px; "><strong style="font-size: 12px; ">CSS 允许应用纯色作为背景，也允许使用背景图像创建相当复杂的效果。CSS 在这方面的能力远远在 HTML 之上</strong></p>
<p style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 18px; "><span style="line-height: normal; ">
</span></p>
<h2 style="font-weight: bold; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; ">背景色</h2>
</span>
<p>&nbsp;</p>
<p style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 18px; ">可以使用<span style="color: red; ">background-color</span> 属性为元素设置背景色，这个属性接受任何合法的颜色值。</p>
<p style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 18px; ">这条规则把元素的背景设为灰色：<span style="color: red; ">p{<span style="color: #ff0000; ">background-color :gray;<span style="color: #000000; ">}</span></span></span></p>
<p style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 18px; ">如果你希望背景色从元素中的文本向外至少有延伸，只需增加一些内边框：<span style="font-family: 'Courier New', monospace; line-height: normal; white-space: pre; "><span style="color: red; ">p {background-color: gray; padding: 20px;}<span  style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: 12px; line-height: 18px; ">background-image 属性的默认值是 none，表示背景上没有放置任何图像。</span></span></span></p>
<p style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 18px; "><span style="line-height: normal; ">
</span></p>
<h2 style="font-weight: bold; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; ">背景图像</h2>
<p>要把图像放入背景，需要使用&nbsp;<span  style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; ">&nbsp;<a href="http://www.w3school.com.cn/css/pr_background-image.asp" title="CSS background-image 属性" style="text-decoration: underline; color: #900b09; background-image: initial; background-repeat: initial; background-attachment: initial; background-color: transparent; background-position: initial initial; ">background-image 属性</a>。</span></p>
<img src ="http://www.blogjava.net/zwyan2009/aggbug/299676.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zwyan2009/" target="_blank">yanZhangWu</a> 2009-10-25 17:17 <a href="http://www.blogjava.net/zwyan2009/archive/2009/10/25/299676.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>