<?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>路途志 &#187; div不兼容</title>
	<atom:link href="http://www.lutuzhi.com/tag/div%e4%b8%8d%e5%85%bc%e5%ae%b9/feed" rel="self" type="application/rss+xml" />
	<link>http://www.lutuzhi.com</link>
	<description>一路走来，路途志</description>
	<lastBuildDate>Mon, 08 Aug 2011 16:04:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>落伍投资在火狐、Chrome下左偏解决办法</title>
		<link>http://www.lutuzhi.com/theweb/423.html</link>
		<comments>http://www.lutuzhi.com/theweb/423.html#comments</comments>
		<pubDate>Fri, 15 Jan 2010 02:41:00 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[网站建设]]></category>
		<category><![CDATA[div不兼容]]></category>
		<category><![CDATA[div左偏]]></category>
		<category><![CDATA[firefox Chrome左偏]]></category>
		<category><![CDATA[IE下正常]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/theweb/423.html</guid>
		<description><![CDATA[概述： 落伍投资网站主体由DIV+CSS构建，开发时一直在IE下预览效果，在这过程中没发现有错位的情况。最近通过统计工具发现，使用火狐访问落伍投资的用户比较多，于是安装了火狐测试了一下。测试过程中发现，几乎所有的页面都存在&#60;body&#62;&#60;div class=”main”&#62;&#60;/div&#62;区域左偏的问题。 解决方案： 在CSS文件中，Main的定义如下： .Main{border-top:1px #c8d8f2 solid;border-bottom:1px #c8d8f2 solid; width:960px; margin-top:20px;text-align:left; } 改为： .Main{border-top:1px #c8d8f2 solid;border-bottom:1px #c8d8f2 solid; width:960px; margin-top:20px;text-align:left;margin: auto; } 上传，刷新页面，现在在firefox和chrome下页面显示和在IE中显示效果完全一样了。 解决过程： 这个问题的分析思路很明确，因为顶部导航和Main区域分别是用&#60;div class =”nav_top”&#62;和&#60;div class=”main”&#62;定义的。但是顶部导航区域一切正常，不存在左偏的问题。接下来就分析在CSS文件中nav_top和main的区别。比较发现，nav_top的定义中多了一个关键的：margin: auto; 问题原因： 在FireFox、Chrome中如果 body 设置 了text-align, div 需要设置 margin: auto 才可以居中，这点和IE的解释是不一致的。在落伍投资的CSS文件中，body恰好定义为： body {text-align:center;background:#ffffff;}]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/theweb/423.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

