<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>liulang&#039;s blog &#187; Web应用</title>
	<atom:link href="http://www.liulang.cq.cn/category/web/feed" rel="self" type="application/rss+xml" />
	<link>http://www.liulang.cq.cn</link>
	<description>既然选择了远方，便只顾风雨兼程……</description>
	<lastBuildDate>Thu, 10 Jun 2010 11:41:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>你需要了解的21个CSS惊人技巧</title>
		<link>http://www.liulang.cq.cn/20091105/21css.html</link>
		<comments>http://www.liulang.cq.cn/20091105/21css.html#comments</comments>
		<pubDate>Thu, 05 Nov 2009 13:03:10 +0000</pubDate>
		<dc:creator>刘 浪</dc:creator>
				<category><![CDATA[Web应用]]></category>

		<guid isPermaLink="false">http://www.liulang.cq.cn/?p=179</guid>
		<description><![CDATA[
　　级联样式表(CSS)在当代Web设计中已经成为重要的环节，如果没有CSS现在的网站将像10年前一样不堪入目。随着CSS技术的普及，越来越多的高质量CSS教程涌入互联网，让我们的学习更加方便。下面彬Go向大家推荐21个惊人的CSS技巧，相信其中必有你想不到的。还等什么，继续往下看吧！
您还可以参考以下CSS相关教程及资源:
《CSS Sprites(CSS图像拼合技术)教程、工具集合》
《学无止境的CSS(xHTML+CSS技巧教程资源大全)》
《精选30个优秀的CSS技术和实例
《使用CSS为图片添加更多趣味的5种方法》
1.CSS跨浏览器幻灯片

点击上图查看清晰原图
演示了如何仅适用CSS打造一个跨浏览器的图片画廊
2.基于CSS的图片地图

这个教程演示了如何使用纯CSS创建一个”疯狂”的图片地图。
3.纯CSS无JavaScript的LightBox

点击上图查看清晰原图
4.CSS图片替换技术制作的按钮

使用CSS将表单提交按钮替换为图片，如果禁用CSS将变回普通按钮。
5.用CSS实现动画导航菜单

6.用CSS创建类似树形导航菜单

7.CSS渐变文字效果

8.CSS目录菜单设计

点击上图查看清晰原图
很容易理解的关于使用CSS border属性或CSS背景图属性实现目录菜单的教程。
9.使用CSS负margin创建自适应布局

10.使用CSS固定你的页脚

点击上图查看清晰原图
你也许会遇到这种情况:当你为每个页面设置相同的页脚后，有些页面的主题内容量很少，使得页脚自动向上移动，看上去的浏览器下面很空。这个教程将教你如何使用CSS固定页脚在页面底部来解决这个头疼的问题。
11.简单、灵活的CSS面包屑导航

12. 为你的博客创建时髦的引用(Pullquotes)

13.CSS实现的柱状图表

14.如何为链接列表创建块级悬停效果

15.CSS多列列表

16.用CSS Sprites技术实现日期显示

17.使用CSS美化你的日期和评论

18.使用CSS创建图片浏览器

点击上图查看清晰原图
19.创建CSS图片预载
无需JavaScript，仅使用CSS背景图属性实现图片的预载。
20.从页面底部淡出效果

点击上图查看清晰原图
21.创意且很酷的CSS边框属性

留意更新
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.bingo929.com/21-amazing-css-techniques-you-should-know.html"><img title="21-css-技巧" src="http://blog.bingo929.com/wp-content/uploads/2009/10/21-css-title.jpg" alt="21-css-技巧" width="500" height="150" /></a><br />
　　级联样式表(CSS)在当代Web设计中已经成为重要的环节，如果没有<a href="http://blog.bingo929.com/category/technology/css">CSS</a>现在的网站将像10年前一样不堪入目。随着<a href="http://blog.bingo929.com/tag/divcss">CSS</a>技术的普及，越来越多的高质量CSS教程涌入互联网，让我们的学习更加方便。下面彬Go向大家推荐21个惊人的CSS技巧，相信其中必有你想不到的。还等什么，继续往下看吧！<span id="more-179"></span></p>
<p><strong><span style="COLOR: #ff6600">您还可以参考以下CSS相关教程及资源:</span></strong><br />
《<a href="http://blog.bingo929.com/css-sprites-css-techniques-tools-tutorials.html">CSS Sprites(CSS图像拼合技术)教程、工具集合</a>》<br />
《<a href="http://blog.bingo929.com/css-div-css-xhtml-css.html">学无止境的CSS(xHTML+CSS技巧教程资源大全)</a>》<br />
《<a href="http://blog.bingo929.com/30-css-tec-examples.html">精选30个优秀的CSS技术和实例</a><br />
《<a href="http://blog.bingo929.com/spice-up-your-images-with-css-5-way.html">使用CSS为图片添加更多趣味的5种方法</a>》</p>
<h3>1.<a href="http://www.cssplay.co.uk/menu/slide_show" target="_blank">CSS跨浏览器幻灯片</a></h3>
<p><a href="http://blog.bingo929.com/wp-content/uploads/2009/10/cross-browser-slide-show.jpg" target="_blank"><img title="跨浏览器CSS幻灯片" src="http://blog.bingo929.com/wp-content/uploads/2009/10/cross-browser-slide-show-500x331.jpg" alt="跨浏览器CSS幻灯片" width="500" height="331" /></a><br />
<em>点击上图查看清晰原图</em><br />
演示了如何仅适用CSS打造一个跨浏览器的图片画廊</p>
<h3>2.<a href="http://www.frankmanno.com/ideas/css-imagemap/" target="_blank">基于CSS的图片地图</a></h3>
<p><img title="CSS-图片地图" src="http://blog.bingo929.com/wp-content/uploads/2009/10/CSS-only-image-map.jpg" alt="CSS-图片地图" width="341" height="261" /><br />
这个教程演示了如何使用纯CSS创建一个”疯狂”的图片地图。</p>
<h3>3.<a href="http://www.cssplay.co.uk/menu/lightbox-hover.html" target="_blank">纯CSS无JavaScript的LightBox</a></h3>
<p><a href="http://blog.bingo929.com/wp-content/uploads/2009/10/Css-Only-LightBox.jpg" target="_blank"><img title="纯CSS无JavaScript的LightBox" src="http://blog.bingo929.com/wp-content/uploads/2009/10/Css-Only-LightBox-499x255.jpg" alt="纯CSS无JavaScript的LightBox" width="499" height="255" /></a><br />
<em>点击上图查看清晰原图</em></p>
<h3>4.<a href="http://www.ampsoft.net/webdesign-l/image-button.html" target="_blank">CSS图片替换技术制作的按钮</a></h3>
<p><a href="http://blog.bingo929.com/"><img title="CSS图片替换技术制作的按钮" src="http://blog.bingo929.com/wp-content/uploads/2009/10/image-replacement-submit-button.jpg" alt="CSS图片替换技术制作的按钮" width="439" height="99" /></a><br />
使用CSS将表单提交按钮替换为图片，如果禁用CSS将变回普通按钮。</p>
<h3>5.<a href="http://www.pmob.co.uk/pob/animated.htm" target="_blank">用CSS实现动画导航菜单</a></h3>
<p><img title="CSS-导航菜单-动画" src="http://blog.bingo929.com/wp-content/uploads/2009/10/animated-navigation-menu.jpg" alt="CSS-导航菜单-动画" width="318" height="71" /></p>
<h3>6.<a href="http://www.zabdesign.de/pro/public/sitemap/sitemap-styled.html" target="_blank">用CSS创建类似树形导航菜单</a></h3>
<p><img title="CSS-树形导航" src="http://blog.bingo929.com/wp-content/uploads/2009/10/tree-like-navigation.png" alt="CSS-树形导航" width="334" height="247" /></p>
<h3>7.<a href="http://www.zabdesign.de/pro/public/sitemap/sitemap-styled.html" target="_blank">CSS渐变文字效果</a></h3>
<p><img title="CSS渐变文字效果" src="http://blog.bingo929.com/wp-content/uploads/2009/10/css-gradient-effect.jpg" alt="CSS渐变文字效果" width="477" height="147" /></p>
<h3>8.<a href="http://www.webdesignerwall.com/tutorials/css-menu-list-design/" target="_blank">CSS目录菜单设计</a></h3>
<p><a href="http://blog.bingo929.com/wp-content/uploads/2009/10/CSS-Menu-List.png" target="_blank"><img title="CSS-目录菜单" src="http://blog.bingo929.com/wp-content/uploads/2009/10/CSS-Menu-List-500x169.png" alt="CSS-目录菜单" width="500" height="169" /></a><br />
<em>点击上图查看清晰原图</em><br />
很容易理解的关于使用CSS border属性或CSS背景图属性实现目录菜单的教程。</p>
<h3>9.<a href="http://www.alistapart.com/articles/negativemargins/" target="_blank">使用CSS负margin创建自适应布局</a></h3>
<p><img title="CSS负margin创建自适应布局" src="http://blog.bingo929.com/wp-content/uploads/2009/10/liquid-web-layout-css-500x177.jpg" alt="CSS负margin创建自适应布局" width="500" height="177" /></p>
<h3>10.<a href="http://fortysevenmedia.com/blog/archives/making_your_footer_stay_put_with_css/" target="_blank">使用CSS固定你的页脚</a></h3>
<p><a href="http://blog.bingo929.com/wp-content/uploads/2009/10/broken.jpg"><img title="CSS-固定-页脚" src="http://blog.bingo929.com/wp-content/uploads/2009/10/broken-500x389.jpg" alt="CSS-固定-页脚" width="500" height="389" /></a><br />
<em>点击上图查看清晰原图</em><br />
你也许会遇到这种情况:当你为每个页面设置相同的页脚后，有些页面的主题内容量很少，使得页脚自动向上移动，看上去的浏览器下面很空。这个教程将教你如何使用CSS固定页脚在页面底部来解决这个头疼的问题。</p>
<h3>11.<a href="http://veerle.duoh.com/blog/comments/simple_scalable_css_based_breadcrumbs/" target="_blank">简单、灵活的CSS面包屑导航</a></h3>
<p><img title="CSS-面包屑-导航" src="http://blog.bingo929.com/wp-content/uploads/2009/10/scalable-breadcrumb-navigation.jpg" alt="CSS-面包屑-导航" width="356" height="45" /></p>
<h3>12.<a href="http://www.pearsonified.com/2006/09/snazzy_pullquotes_for_your_blo.php" target="_blank"> 为你的博客创建时髦的引用(Pullquotes)</a></h3>
<p><a href="http://blog.bingo929.com/wp-content/uploads/2009/10/pullquotes-css.png"><img title="pullquotes-css" src="http://blog.bingo929.com/wp-content/uploads/2009/10/pullquotes-css-500x157.png" alt="pullquotes-css" width="500" height="157" /></a></p>
<h3>13.<a href="http://www.thewojogroup.com/2008/12/css-stacked-bar-graphs/" target="_blank">CSS实现的柱状图表</a></h3>
<p><img title="CSS-图表" src="http://blog.bingo929.com/wp-content/uploads/2009/10/stacked-bar-graph.jpg" alt="CSS-图表" width="444" height="305" /></p>
<h3>14.<a href="http://www.smileycat.com/miaow/archives/000230.php" target="_blank">如何为链接列表创建块级悬停效果</a></h3>
<p><img title="CSS-技巧" src="http://blog.bingo929.com/wp-content/uploads/2009/10/Block-Hover-CSS-List.png" alt="CSS-技巧" width="414" height="286" /></p>
<h3>15.<a href="http://www.alistapart.com/articles/multicolumnlists" target="_blank">CSS多列列表</a></h3>
<p><img title="CSS多列列表" src="http://blog.bingo929.com/wp-content/uploads/2009/10/Multi-Column-Lists.png" alt="CSS多列列表" width="458" height="133" /></p>
<h3>16.<a href="http://css-tricks.com/date-display-with-sprites/" target="_blank">用CSS Sprites技术实现日期显示</a></h3>
<p><img title="用CSS Sprites技术实现日期显示" src="http://blog.bingo929.com/wp-content/uploads/2009/10/Display-Date-Using-Sprites.png" alt="用CSS Sprites技术实现日期显示" width="417" height="165" /></p>
<h3>17.<a href="http://css-tricks.com/date-badges-and-comment-bubbles-for-your-blog/" target="_blank">使用CSS美化你的日期和评论</a></h3>
<p><img title="CSS" src="http://blog.bingo929.com/wp-content/uploads/2009/10/date-comment-badges.jpg" alt="CSS" width="269" height="172" /></p>
<h3>18.<a href="http://www.devirtuoso.com/2009/07/how-to-build-a-css-image-viewer-the-clever-way/" target="_blank">使用CSS创建图片浏览器</a></h3>
<p><a href="http://blog.bingo929.com/wp-content/uploads/2009/10/CSS-Image-viewer.jpg"><img title="CSS-图片浏览器" src="http://blog.bingo929.com/wp-content/uploads/2009/10/CSS-Image-viewer-500x296.jpg" alt="CSS-图片浏览器" width="500" height="296" /></a><br />
<em>点击上图查看清晰原图</em></p>
<h3>19.<a href="http://www.devirtuoso.com/2009/07/creating-a-css-image-preloader/" target="_blank">创建CSS图片预载</a></h3>
<p>无需JavaScript，仅使用CSS背景图属性实现图片的预载。</p>
<h3>20.<a href="http://css-tricks.com/css-trick-fade-out-the-bottom-of-pages-with-a-fixed-position-image/" target="_blank">从页面底部淡出效果</a></h3>
<p><a href="http://blog.bingo929.com/wp-content/uploads/2009/10/Fade-Out-Bottom.jpg"><img title="CSS-淡出" src="http://blog.bingo929.com/wp-content/uploads/2009/10/Fade-Out-Bottom-500x236.jpg" alt="CSS-淡出" width="500" height="236" /></a><br />
<em>点击上图查看清晰原图</em></p>
<h3>21.<a href="http://www.cssnewbie.com/12-creative-and-cool-uses-for-the-css-border-property/" target="_blank">创意且很酷的CSS边框属性</a></h3>
<p><a href="http://blog.bingo929.com/wp-content/uploads/2009/10/CSS-Border-Property.jpg"><img title="CSS-Border-属性" src="http://blog.bingo929.com/wp-content/uploads/2009/10/CSS-Border-Property-500x175.jpg" alt="CSS-Border-属性" width="500" height="175" /></a></p>
<h3>留意更新</h3>
]]></content:encoded>
			<wfw:commentRss>http://www.liulang.cq.cn/20091105/21css.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>最常用和实用的CSS技巧</title>
		<link>http://www.liulang.cq.cn/20090731/%e6%9c%80%e5%b8%b8%e7%94%a8%e5%92%8c%e5%ae%9e%e7%94%a8%e7%9a%84css%e6%8a%80%e5%b7%a7.html</link>
		<comments>http://www.liulang.cq.cn/20090731/%e6%9c%80%e5%b8%b8%e7%94%a8%e5%92%8c%e5%ae%9e%e7%94%a8%e7%9a%84css%e6%8a%80%e5%b7%a7.html#comments</comments>
		<pubDate>Fri, 31 Jul 2009 09:34:43 +0000</pubDate>
		<dc:creator>刘 浪</dc:creator>
				<category><![CDATA[Web应用]]></category>

		<guid isPermaLink="false">http://www.liulang.cq.cn/?p=36</guid>
		<description><![CDATA[下面是CSS最常用和实用的技巧。

1.重置浏览器的字体大小
重置浏览器的默认值 ，然后重设浏览器的字体大小你可以使用雅虎的用户界面重置的CSS方案 ，如果你不想下载9MB的文件，代码如下：



Java代码 


body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p, 
blockquote,th,td {margin:0; padding:0; } 
table { border-collapse:collapse; border-spacing:0; } 
fieldset,img { border:0; } 
address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; } 
ol,ul { list-style:none; } 
caption,th { text-align:left; } 
h1,h2,h3,h4,h5,h6 { font-size:100%; font-weight:normal; } 
q:before,q:after { content:”; } 
abbr,acronym { border:0; } 





其次，我们重设浏览器字体的大小为10像素，使用如下： 
 


Java代码 


html {font-size: 62.5%;} 


这个大小基本合适，然后您可以根据自己的需要调整大小，如 标题1为120像素:


Java代码 


h1 {font-size: 2em;} 




2.设置水平居中
大多数的网站目前都是固定宽度的。CSS代码如下：



Java代码 


div#container {margin: 0 auto;} 


3.控制位置：绝对位置，相对位置
假如有两个div


Java代码 


&#60;div id=&#8216;parent&#8217;&#62; 
&#60;div id=&#8217;son&#8217;&#62;&#60;/div&#62; 
&#60;/div&#62; 


div有left和top属性,是用来定位的.
如果内层的div的position属性是absolute.那他就是相对于文档的左上角的位置..
如果内层的div(id为son的那个)position属性为relative,那它的left和top值就是相对于外层的div的左上角的距离.

4.将重要元素放置在屏幕中央
如果你希望将您想要的东西放在最中央，可以使用以下CSS：


Java代码 


div.popup { height:400px; width:500px; position: absolute; top: 50%; left: 50%;} 
div.popup { margin-top: -200px; margin-left: -250px;} 


您必须明确的指定宽度和高度，再把top和left属性设为他们的一半，这样就可以是这个部分回到屏幕的中心。
5.可以重复利用的规则



Java代码 


.left {float: left;} 
.right {float: right;} 
img .left { border:2px solid #aaaaaa; margin: 0 10px 0 0;} 
img .right { border:2px solid #aaaaaa; margin: 0 0 0 10px; padding: 1px;} 


设置自己的CSS样式表，就可以在您需要的时候直接的添加标记即可。


6. 解决IE6 的浮动元素的双倍边距问题
对一个div设置了float:left 和 margin-left:100px 那么在IE6中，这个bug就会出现。您只需要多设置一个display即可，代码如下：


Java代码 


div {float:left;margin:40px;display:inline;} 


7.简单的导航菜单
在您的设计中预设一个导航栏是非常有益的。可以让别人对你网页的主要内容有一个大致的了解。第一次来的XHTML：


Java代码 


&#60;div id=”navbar”&#62; 
&#60;ul&#62; 
&#60;li&#62;&#60;a href=”http://www.peakflowdesign.com”&#62;Peakflow Design&#60;/a&#62;&#60;/li&#62; 
&#60;li&#62;&#60;a href=”http://www.google.com”&#8221;&#62;Google&#60;/a&#62;&#60;/li&#62; 
&#60;li&#62;&#60;a href=”http://zenhabits.net/”&#62;Zen Habits&#60;/a&#62;&#60;/li&#62; 
&#60;/ul&#62; 
&#60;/div&#62; 


CSS代码：


Java代码 


#navbar ul li {display:inline;margin:0 10px 0 0;} [...]]]></description>
			<content:encoded><![CDATA[<p>下面是CSS最常用和实用的技巧。<br />
<span style="color: #00008b;"><strong><br />
1.重置浏览器的字体大小</strong></span><br />
重置浏览器的默认值 ，然后<a style="color: #bc2a4d; text-decoration: underline;" href="http://www.peakflowdesign.com/wordpress/essential-wordpress-toolkit-for-creating-new-themes/" target="_blank">重设浏览器</a>的字体大小你可以使用<a style="color: #006699; text-decoration: underline;" href="http://developer.yahoo.com/yui/reset/" target="_blank">雅虎的用户界面重置</a>的CSS方案 ，如果你不想下载9MB的文件，代码如下：</p>
<div><span style="font-family: Arial; line-height: 25px; font-size: 14px; "></p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; "><span id="more-36"></span>Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="10" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=body%2Cdiv%2Cdl%2Cdt%2Cdd%2Cul%2Col%2Cli%2Ch1%2Ch2%2Ch3%2Ch4%2Ch5%2Ch6%2Cpre%2Cform%2Cfieldset%2Cinput%2Ctextarea%2Cp%2C%0Ablockquote%2Cth%2Ctd%20%7Bmargin%3A0%3B%20padding%3A0%3B%20%7D%0Atable%20%7B%20border-collapse%3Acollapse%3B%20border-spacing%3A0%3B%20%7D%0Afieldset%2Cimg%20%7B%20border%3A0%3B%20%7D%0Aaddress%2Ccaption%2Ccite%2Ccode%2Cdfn%2Cem%2Cstrong%2Cth%2Cvar%20%7B%20font-style%3Anormal%3B%20font-weight%3Anormal%3B%20%7D%0Aol%2Cul%20%7B%20list-style%3Anone%3B%20%7D%0Acaption%2Cth%20%7B%20text-align%3Aleft%3B%20%7D%0Ah1%2Ch2%2Ch3%2Ch4%2Ch5%2Ch6%20%7B%20font-size%3A100%25%3B%20font-weight%3Anormal%3B%20%7D%0Aq%3Abefore%2Cq%3Aafter%20%7B%20content%3A%E2%80%9D%3B%20%7D%0Aabbr%2Cacronym%20%7B%20border%3A0%3B%20%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="10" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=body%2Cdiv%2Cdl%2Cdt%2Cdd%2Cul%2Col%2Cli%2Ch1%2Ch2%2Ch3%2Ch4%2Ch5%2Ch6%2Cpre%2Cform%2Cfieldset%2Cinput%2Ctextarea%2Cp%2C%0Ablockquote%2Cth%2Ctd%20%7Bmargin%3A0%3B%20padding%3A0%3B%20%7D%0Atable%20%7B%20border-collapse%3Acollapse%3B%20border-spacing%3A0%3B%20%7D%0Afieldset%2Cimg%20%7B%20border%3A0%3B%20%7D%0Aaddress%2Ccaption%2Ccite%2Ccode%2Cdfn%2Cem%2Cstrong%2Cth%2Cvar%20%7B%20font-style%3Anormal%3B%20font-weight%3Anormal%3B%20%7D%0Aol%2Cul%20%7B%20list-style%3Anone%3B%20%7D%0Acaption%2Cth%20%7B%20text-align%3Aleft%3B%20%7D%0Ah1%2Ch2%2Ch3%2Ch4%2Ch5%2Ch6%20%7B%20font-size%3A100%25%3B%20font-weight%3Anormal%3B%20%7D%0Aq%3Abefore%2Cq%3Aafter%20%7B%20content%3A%E2%80%9D%3B%20%7D%0Aabbr%2Cacronym%20%7B%20border%3A0%3B%20%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p, </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">blockquote,th,td {margin:<span class="number" style="color: #c00000; ">0</span><span style="color: black; ">; padding:</span><span class="number" style="color: #c00000; ">0</span><span style="color: black; ">; } </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">table { border-collapse:collapse; border-spacing:<span class="number" style="color: #c00000; ">0</span><span style="color: black; ">; } </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">fieldset,img { border:<span class="number" style="color: #c00000; ">0</span><span style="color: black; ">; } </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; } </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">ol,ul { list-style:none; } </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">caption,th { text-align:left; } </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">h1,h2,h3,h4,h5,h6 { font-size:<span class="number" style="color: #c00000; ">100</span><span style="color: black; ">%; font-weight:normal; } </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">q:before,q:after { content:”; } </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">abbr,acronym { border:<span class="number" style="color: #c00000; ">0</span><span style="color: black; ">; } </span></span></li>
<div><span style="color: #000000;"><span style="line-height: 18px;"><br />
</span></span></div>
</ol>
</div>
<p></span></div>
<p><span style="font-family: Arial; line-height: 25px; font-size: 14px; ">其次，我们重设浏览器字体的大小为10像素，使用如下： </span></p>
<p><span style="font-family: Arial; line-height: 25px; font-size: 14px; "> </span></p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=html%20%7Bfont-size%3A%2062.5%25%3B%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=html%20%7Bfont-size%3A%2062.5%25%3B%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">html {font-size: </span><span class="number" style="color: #c00000; ">62.5</span><span style="color: black; ">%;} </span></span></li>
</ol>
</div>
<p>这个大小基本合适，然后您可以根据自己的需要调整大小，如 标题1为120像素:</p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=h1%20%7Bfont-size%3A%202em%3B%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=h1%20%7Bfont-size%3A%202em%3B%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">h1 {font-size: 2em;} </span></span></li>
<div><span style="color: #000000;"><span style="line-height: 18px;"><br />
</span></span></div>
</ol>
</div>
<p><span style="font-family: Arial; line-height: 25px; font-size: 14px; "><strong><span style="color: #00008b; ">2.设置水平居中</span></strong><br />
大多数的网站目前都是固定宽度的。CSS代码如下：<br />
</span></p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=div%23container%20%7Bmargin%3A%200%20auto%3B%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=div%23container%20%7Bmargin%3A%200%20auto%3B%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">div#container {margin: </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; "> auto;} </span></span></li>
</ol>
</div>
<p><span style="color: #00008b; "><strong>3.控制位置：绝对位置，相对位置</strong></span><br />
假如有两个div</p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=%3Cdiv%20id%3D'parent'%3E%0A%3Cdiv%20id%3D'son'%3E%3C%2Fdiv%3E%0A%3C%2Fdiv%3E" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=%3Cdiv%20id%3D'parent'%3E%0A%3Cdiv%20id%3D'son'%3E%3C%2Fdiv%3E%0A%3C%2Fdiv%3E"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">&lt;div id=</span><span class="string" style="color: blue; ">&#8216;parent&#8217;</span><span style="color: black; ">&gt; </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;div id=<span class="string" style="color: blue; ">&#8217;son&#8217;</span><span style="color: black; ">&gt;&lt;/div&gt; </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/div&gt; </span></li>
</ol>
</div>
<p>div有left和top属性,是用来定位的.<br />
如果内层的div的position属性是absolute.那他就是相对于文档的左上角的位置..<br />
如果内层的div(id为son的那个)position属性为relative,那它的left和top值就是相对于外层的div的左上角的距离.</p>
<p><span style="color: #00008b; "><strong><br />
4.将重要元素放置在屏幕中央</strong></span><br />
如果你希望将您想要的东西放在最中央，可以使用以下CSS：</p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=div.popup%20%7B%20height%3A400px%3B%20width%3A500px%3B%20position%3A%20absolute%3B%20top%3A%2050%25%3B%20left%3A%2050%25%3B%7D%0Adiv.popup%20%7B%20margin-top%3A%20-200px%3B%20margin-left%3A%20-250px%3B%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=div.popup%20%7B%20height%3A400px%3B%20width%3A500px%3B%20position%3A%20absolute%3B%20top%3A%2050%25%3B%20left%3A%2050%25%3B%7D%0Adiv.popup%20%7B%20margin-top%3A%20-200px%3B%20margin-left%3A%20-250px%3B%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">div.popup { height:400px; width:500px; position: absolute; top: </span><span class="number" style="color: #c00000; ">50</span><span style="color: black; ">%; left: </span><span class="number" style="color: #c00000; ">50</span><span style="color: black; ">%;} </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">div.popup { margin-top: -200px; margin-left: -250px;} </span></li>
</ol>
</div>
<p>您必须明确的指定宽度和高度，再把top和left属性设为他们的一半，这样就可以是这个部分回到屏幕的中心。</p>
<p><span style="font-family: Arial; line-height: 25px; font-size: 14px; "><span style="color: #00008b; "><strong>5.可以重复利用的规则</strong></span><br />
</span></p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=.left%20%7Bfloat%3A%20left%3B%7D%0A.right%20%7Bfloat%3A%20right%3B%7D%0Aimg%20.left%20%7B%20border%3A2px%20solid%20%23aaaaaa%3B%20margin%3A%200%2010px%200%200%3B%7D%0Aimg%20.right%20%7B%20border%3A2px%20solid%20%23aaaaaa%3B%20margin%3A%200%200%200%2010px%3B%20padding%3A%201px%3B%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=.left%20%7Bfloat%3A%20left%3B%7D%0A.right%20%7Bfloat%3A%20right%3B%7D%0Aimg%20.left%20%7B%20border%3A2px%20solid%20%23aaaaaa%3B%20margin%3A%200%2010px%200%200%3B%7D%0Aimg%20.right%20%7B%20border%3A2px%20solid%20%23aaaaaa%3B%20margin%3A%200%200%200%2010px%3B%20padding%3A%201px%3B%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">.left {</span><span class="keyword" style="color: #7f0055; font-weight: bold; ">float</span><span style="color: black; ">: left;} </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">.right {<span class="keyword" style="color: #7f0055; font-weight: bold; ">float</span><span style="color: black; ">: right;} </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">img .left { border:2px solid #aaaaaa; margin: <span class="number" style="color: #c00000; ">0</span><span style="color: black; "> 10px </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; "> </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; ">;} </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">img .right { border:2px solid #aaaaaa; margin: <span class="number" style="color: #c00000; ">0</span><span style="color: black; "> </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; "> </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; "> 10px; padding: 1px;} </span></span></li>
</ol>
</div>
<p>设置自己的CSS样式表，就可以在您需要的时候直接的添加标记即可。<br />
<img style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " src="http://www.peakflowdesign.com/articles/10usefulcsstricks/bridge.jpg" alt="" /></p>
<p><strong><br />
<span style="color: #00008b; ">6. 解决IE6 的浮动元素的双倍边距问题</span></strong><br />
对一个div设置了float:left 和 margin-left:100px 那么在IE6中，这个bug就会出现。您只需要多设置一个display即可，代码如下：</p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=div%20%7Bfloat%3Aleft%3Bmargin%3A40px%3Bdisplay%3Ainline%3B%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=div%20%7Bfloat%3Aleft%3Bmargin%3A40px%3Bdisplay%3Ainline%3B%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">div {</span><span class="keyword" style="color: #7f0055; font-weight: bold; ">float</span><span style="color: black; ">:left;margin:40px;display:inline;} </span></span></li>
</ol>
</div>
<p><strong>7.简单的导航菜单</strong><br />
在您的设计中预设一个导航栏是非常有益的。可以让别人对你网页的主要内容有一个大致的了解。第一次来的XHTML：</p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=%3Cdiv%20id%3D%E2%80%9Dnavbar%E2%80%9D%3E%0A%3Cul%3E%0A%3Cli%3E%3Ca%20href%3D%E2%80%9Dhttp%3A%2F%2Fwww.peakflowdesign.com%E2%80%9D%3EPeakflow%20Design%3C%2Fa%3E%3C%2Fli%3E%0A%3Cli%3E%3Ca%20href%3D%E2%80%9Dhttp%3A%2F%2Fwww.google.com%E2%80%9D%22%3EGoogle%3C%2Fa%3E%3C%2Fli%3E%0A%3Cli%3E%3Ca%20href%3D%E2%80%9Dhttp%3A%2F%2Fzenhabits.net%2F%E2%80%9D%3EZen%20Habits%3C%2Fa%3E%3C%2Fli%3E%0A%3C%2Ful%3E%0A%3C%2Fdiv%3E" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=%3Cdiv%20id%3D%E2%80%9Dnavbar%E2%80%9D%3E%0A%3Cul%3E%0A%3Cli%3E%3Ca%20href%3D%E2%80%9Dhttp%3A%2F%2Fwww.peakflowdesign.com%E2%80%9D%3EPeakflow%20Design%3C%2Fa%3E%3C%2Fli%3E%0A%3Cli%3E%3Ca%20href%3D%E2%80%9Dhttp%3A%2F%2Fwww.google.com%E2%80%9D%22%3EGoogle%3C%2Fa%3E%3C%2Fli%3E%0A%3Cli%3E%3Ca%20href%3D%E2%80%9Dhttp%3A%2F%2Fzenhabits.net%2F%E2%80%9D%3EZen%20Habits%3C%2Fa%3E%3C%2Fli%3E%0A%3C%2Ful%3E%0A%3C%2Fdiv%3E"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">&lt;div id=”navbar”&gt; </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;ul&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;li&gt;&lt;a href=”http:<span class="comment" style="color: #008200; ">//www.peakflowdesign.com”&gt;Peakflow Design&lt;/a&gt;&lt;/li&gt;</span><span style="color: black; "> </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;li&gt;&lt;a href=”http:<span class="comment" style="color: #008200; ">//www.google.com”&#8221;&gt;Google&lt;/a&gt;&lt;/li&gt;</span><span style="color: black; "> </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;li&gt;&lt;a href=”http:<span class="comment" style="color: #008200; ">//zenhabits.net/”&gt;Zen Habits&lt;/a&gt;&lt;/li&gt;</span><span style="color: black; "> </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/ul&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/div&gt; </span></li>
</ol>
</div>
<p>CSS代码：</p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=%23navbar%20ul%20li%20%7Bdisplay%3Ainline%3Bmargin%3A0%2010px%200%200%3B%7D%0A%23navbar%20ul%20li%20a%20%7Bcolor%3A%20%23333%3Bdisplay%3Ablock%3Bfloat%3Aleft%3Bpadding%3A5px%3B%7D%0A%23navbar%20ul%20li%20a%3Ahover%20%7Bbackground%3A%23eee%3Bcolor%3Ablack%3B%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=%23navbar%20ul%20li%20%7Bdisplay%3Ainline%3Bmargin%3A0%2010px%200%200%3B%7D%0A%23navbar%20ul%20li%20a%20%7Bcolor%3A%20%23333%3Bdisplay%3Ablock%3Bfloat%3Aleft%3Bpadding%3A5px%3B%7D%0A%23navbar%20ul%20li%20a%3Ahover%20%7Bbackground%3A%23eee%3Bcolor%3Ablack%3B%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">#navbar ul li {display:inline;margin:</span><span class="number" style="color: #c00000; ">0</span><span style="color: black; "> 10px </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; "> </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; ">;} </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">#navbar ul li a {color: #<span class="number" style="color: #c00000; ">333</span><span style="color: black; ">;display:block;</span><span class="keyword" style="color: #7f0055; font-weight: bold; ">float</span><span style="color: black; ">:left;padding:5px;} </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">#navbar ul li a:hover {background:#eee;color:black;} </span></li>
</ol>
</div>
<p><span style="color: #00008b; "><strong><br />
8.不使用table的form表单</strong></span><br />
正如我们现在进行网站设计的table-free，把重点是放在使用DIVs上。不再对表的列和域进行约束，所以我们需要一些好用的CSS，在<a style="color: #006699; text-decoration: underline; " href="http://jeffhowden.com/code/css/forms/" target="_blank">JeddHowden.com </a>发现</p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=XHTML%3A%0A%3Cform%20action%3D%E2%80%9Dform.php%E2%80%9D%20method%3D%E2%80%9Dpost%E2%80%9D%3E%0A%3Cfieldset%3E%0A%3Clegend%3EPersonal%20Information%3C%2Flegend%3E%0A%3Cdiv%3E%0A%3Clabel%20for%3D%E2%80%9Dfirst_name%E2%80%9D%3EFirst%20Name%3A%3C%2Flabel%3E%0A%3Cinput%20type%3D%E2%80%9Dtext%E2%80%9D%20name%3D%E2%80%9Dfirst_name%E2%80%9D%20id%3D%E2%80%9Dfirst_name%E2%80%9D%20size%3D%E2%80%9D10%E2%80%B3%20value%3D%E2%80%9D%22%20%2F%3E%0A%3C%2Fdiv%3E%0A%3Cdiv%3E%0A%3Clabel%20for%3D%E2%80%9Dlast_name%E2%80%9D%3ELast%20Name%3A%3C%2Flabel%3E%0A%3Cinput%20type%3D%E2%80%9Dtext%E2%80%9D%20name%3D%E2%80%9Dlast_name%E2%80%9D%20id%3D%E2%80%9Dlast_name%E2%80%9D%20size%3D%E2%80%9D10%E2%80%B3%20value%3D%E2%80%9D%22%20%2F%3E%0A%3C%2Fdiv%3E%0A%3Cdiv%3E%0A%3Clabel%20for%3D%E2%80%9Dpostal%E2%80%9D%3EZip%2FPostal%20Code%3A%3C%2Flabel%3E%0A%3Cinput%20type%3D%E2%80%9Dtext%E2%80%9D%20name%3D%E2%80%9Dpostal%E2%80%9D%20id%3D%E2%80%9Dpostal%E2%80%9D%20size%3D%E2%80%9D10%E2%80%B3%20value%3D%E2%80%9D%22%20%2F%3E%0A%3C%2Fdiv%3E%0A%3C%2Ffieldset%3E%0A%3C%2Fform%3E" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=XHTML%3A%0A%3Cform%20action%3D%E2%80%9Dform.php%E2%80%9D%20method%3D%E2%80%9Dpost%E2%80%9D%3E%0A%3Cfieldset%3E%0A%3Clegend%3EPersonal%20Information%3C%2Flegend%3E%0A%3Cdiv%3E%0A%3Clabel%20for%3D%E2%80%9Dfirst_name%E2%80%9D%3EFirst%20Name%3A%3C%2Flabel%3E%0A%3Cinput%20type%3D%E2%80%9Dtext%E2%80%9D%20name%3D%E2%80%9Dfirst_name%E2%80%9D%20id%3D%E2%80%9Dfirst_name%E2%80%9D%20size%3D%E2%80%9D10%E2%80%B3%20value%3D%E2%80%9D%22%20%2F%3E%0A%3C%2Fdiv%3E%0A%3Cdiv%3E%0A%3Clabel%20for%3D%E2%80%9Dlast_name%E2%80%9D%3ELast%20Name%3A%3C%2Flabel%3E%0A%3Cinput%20type%3D%E2%80%9Dtext%E2%80%9D%20name%3D%E2%80%9Dlast_name%E2%80%9D%20id%3D%E2%80%9Dlast_name%E2%80%9D%20size%3D%E2%80%9D10%E2%80%B3%20value%3D%E2%80%9D%22%20%2F%3E%0A%3C%2Fdiv%3E%0A%3Cdiv%3E%0A%3Clabel%20for%3D%E2%80%9Dpostal%E2%80%9D%3EZip%2FPostal%20Code%3A%3C%2Flabel%3E%0A%3Cinput%20type%3D%E2%80%9Dtext%E2%80%9D%20name%3D%E2%80%9Dpostal%E2%80%9D%20id%3D%E2%80%9Dpostal%E2%80%9D%20size%3D%E2%80%9D10%E2%80%B3%20value%3D%E2%80%9D%22%20%2F%3E%0A%3C%2Fdiv%3E%0A%3C%2Ffieldset%3E%0A%3C%2Fform%3E"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">XHTML: </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;form action=”form.php” method=”post”&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;fieldset&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;legend&gt;Personal Information&lt;/legend&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;div&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;label <span class="keyword" style="color: #7f0055; font-weight: bold; ">for</span><span style="color: black; ">=”first_name”&gt;First Name:&lt;/label&gt; </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;input type=”text” name=”first_name” id=”first_name” size=”<span class="number" style="color: #c00000; ">10</span><span style="color: black; ">″ value=”&#8221; /&gt; </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/div&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;div&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;label <span class="keyword" style="color: #7f0055; font-weight: bold; ">for</span><span style="color: black; ">=”last_name”&gt;Last Name:&lt;/label&gt; </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;input type=”text” name=”last_name” id=”last_name” size=”<span class="number" style="color: #c00000; ">10</span><span style="color: black; ">″ value=”&#8221; /&gt; </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/div&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;div&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;label <span class="keyword" style="color: #7f0055; font-weight: bold; ">for</span><span style="color: black; ">=”postal”&gt;Zip/Postal Code:&lt;/label&gt; </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;input type=”text” name=”postal” id=”postal” size=”<span class="number" style="color: #c00000; ">10</span><span style="color: black; ">″ value=”&#8221; /&gt; </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/div&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/fieldset&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/form&gt; </span></li>
</ol>
</div>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=CSS%3A%0Aform%20div%20%7Bclear%3Aleft%3Bdisplay%3Ablock%3Bwidth%3A400px%3Bzoom%3A1%3Bmargin%3A5px%200%200%200%3Bpadding%3A1px%203px%3B%7D%0Aform%20div%20label%20%7Bdisplay%3Ablock%3Bfloat%3Aleft%3Bwidth%3A130px%3Bpadding%3A3px%205px%3Bmargin%3A%200%200%205px%200%3Btext-align%3Aright%3B%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=CSS%3A%0Aform%20div%20%7Bclear%3Aleft%3Bdisplay%3Ablock%3Bwidth%3A400px%3Bzoom%3A1%3Bmargin%3A5px%200%200%200%3Bpadding%3A1px%203px%3B%7D%0Aform%20div%20label%20%7Bdisplay%3Ablock%3Bfloat%3Aleft%3Bwidth%3A130px%3Bpadding%3A3px%205px%3Bmargin%3A%200%200%205px%200%3Btext-align%3Aright%3B%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">CSS: </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">form div {clear:left;display:block;width:400px;zoom:<span class="number" style="color: #c00000; ">1</span><span style="color: black; ">;margin:5px </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; "> </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; "> </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; ">;padding:1px 3px;} </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">form div label {display:block;<span class="keyword" style="color: #7f0055; font-weight: bold; ">float</span><span style="color: black; ">:left;width:130px;padding:3px 5px;margin: </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; "> </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; "> 5px </span><span class="number" style="color: #c00000; ">0</span><span style="color: black; ">;text-align:right;} </span></span></li>
</ol>
</div>
<p><span style="color: #00008b; "><strong><br />
9.让footer总是停留在页面的底部</strong></span><br />
在网页的底部总是保留着公司的版本信息，如何是这部分信息来实现呢？这是一个很古老的技术，这都要归功于<a style="color: #006699; text-decoration: underline; " href="http://www.themaninblue.com/writing/perspective/2005/08/29/" target="_blank">The Man in Blue</a> 。</p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=XHTML%EF%BC%9A%0A%3Cbody%3E%0A%3Cdiv%20id%3D%E2%80%9DnonFooter%E2%80%9D%3E%0A%3Cdiv%20id%3D%E2%80%9Dcontent%E2%80%9D%3E%20*Place%20all%20page%20content%20here*%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%3Cdiv%20id%3D%E2%80%9Dfooter%E2%80%9D%3E%20*Place%20anything%20you%20want%20in%20your%20footer%20here*%0A%3C%2Fdiv%3E%0A%3C%2Fbody%3E" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=XHTML%EF%BC%9A%0A%3Cbody%3E%0A%3Cdiv%20id%3D%E2%80%9DnonFooter%E2%80%9D%3E%0A%3Cdiv%20id%3D%E2%80%9Dcontent%E2%80%9D%3E%20*Place%20all%20page%20content%20here*%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%3Cdiv%20id%3D%E2%80%9Dfooter%E2%80%9D%3E%20*Place%20anything%20you%20want%20in%20your%20footer%20here*%0A%3C%2Fdiv%3E%0A%3C%2Fbody%3E"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">XHTML： </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;body&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;div id=”nonFooter”&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;div id=”content”&gt; *Place all page content here* &lt;/div&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/div&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;div id=”footer”&gt; *Place anything you want in your footer here* </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/div&gt; </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">&lt;/body&gt; </span></li>
</ol>
</div>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=CSS%3A%0Ahtml%2C%20body%20%7B%20height%3A%20100%25%3B%20%7D%0A%23nonFooter%20%7B%20position%3A%20relative%3B%20min-height%3A%20100%25%3B%20%7D%0A*%20html%20%23nonFooter%20%7B%20height%3A%20100%25%3B%20%7D%0A%23content%20%7B%20padding-bottom%3A%209em%3B%20%7D%0A%23footer%20%7B%20position%3A%20relative%3B%20margin-top%3A%20-7.5em%3B%20%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=CSS%3A%0Ahtml%2C%20body%20%7B%20height%3A%20100%25%3B%20%7D%0A%23nonFooter%20%7B%20position%3A%20relative%3B%20min-height%3A%20100%25%3B%20%7D%0A*%20html%20%23nonFooter%20%7B%20height%3A%20100%25%3B%20%7D%0A%23content%20%7B%20padding-bottom%3A%209em%3B%20%7D%0A%23footer%20%7B%20position%3A%20relative%3B%20margin-top%3A%20-7.5em%3B%20%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">CSS: </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">html, body { height: <span class="number" style="color: #c00000; ">100</span><span style="color: black; ">%; } </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">#nonFooter { position: relative; min-height: <span class="number" style="color: #c00000; ">100</span><span style="color: black; ">%; } </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">* html #nonFooter { height: <span class="number" style="color: #c00000; ">100</span><span style="color: black; ">%; } </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">#content { padding-bottom: 9em; } </span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">#footer { position: relative; margin-top: -<span class="number" style="color: #c00000; ">7</span><span style="color: black; ">.5em; } </span></span></li>
</ol>
</div>
<p><span style="color: #00008b; "><strong>10.在同一元素上使用多种类</strong></span><br />
随着有用的功能越来越多的，大多数的人都忽略了内部CSS的选择。一个元素可以套用很多的类，例如：</p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=.red%20%7Bcolor%3A%20red%3B%7D%0A.bold%20%7Bfont-weight%3A%20strong%3B%7D" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=.red%20%7Bcolor%3A%20red%3B%7D%0A.bold%20%7Bfont-weight%3A%20strong%3B%7D"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">.red {color: red;} </span></span></li>
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">.bold {font-weight: strong;} </span></li>
</ol>
</div>
<p>我们可以运用它：</p>
<div class="dp-highlighter" style="font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; background-color: transparent; width: 640px; overflow-x: auto; overflow-y: auto; margin-left: 9px; word-break: break-all; word-wrap: break-word; padding: 1px;">
<div class="bar">
<div class="tools" style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-weight: bold; ">Java代码 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="14" height="15" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="clipboard=%3Cp%20class%3D%E2%80%9Dred%20bold%E2%80%9D%3EThis%20text%20will%20be%20red%20yet%20also%20bold!%3C%2Fp%3E" /><param name="src" value="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" quality="high" flashvars="clipboard=%3Cp%20class%3D%E2%80%9Dred%20bold%E2%80%9D%3EThis%20text%20will%20be%20red%20yet%20also%20bold!%3C%2Fp%3E"></embed></object></div>
</div>
<ol class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; ">
<li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span style="color: black; ">&lt;p </span><span class="keyword" style="color: #7f0055; font-weight: bold; ">class</span><span style="color: black; ">=”red bold”&gt;This text will be red yet also bold!&lt;/p&gt; </span></span></li>
</ol>
</div>
<p>希望这些能对您有所帮助！</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">blockquote,th,td {margin:0; padding:0; }</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">table { border-collapse:collapse; border-spacing:0; }</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">fieldset,img { border:0; }</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; }</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">ol,ul { list-style:none; }</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">caption,th { text-align:left; }</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">h1,h2,h3,h4,h5,h6 { font-size:100%; font-weight:normal; }</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">q:before,q:after { content:”; }</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">abbr,acronym { border:0; }</div>
]]></content:encoded>
			<wfw:commentRss>http://www.liulang.cq.cn/20090731/%e6%9c%80%e5%b8%b8%e7%94%a8%e5%92%8c%e5%ae%9e%e7%94%a8%e7%9a%84css%e6%8a%80%e5%b7%a7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
