<?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; 水平居中</title>
	<atom:link href="http://zhoumo123.cn/tag/%e6%b0%b4%e5%b9%b3%e5%b1%85%e4%b8%ad/feed" rel="self" type="application/rss+xml" />
	<link>http://zhoumo123.cn</link>
	<description>知识分享，共同进步。zhoumo123.cn</description>
	<lastBuildDate>Thu, 07 Nov 2019 05:53:49 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.1</generator>
	<item>
		<title>div css 如何实现div水平居中</title>
		<link>http://zhoumo123.cn/web/css/225.html</link>
		<comments>http://zhoumo123.cn/web/css/225.html#comments</comments>
		<pubDate>Sun, 10 Aug 2014 01:24:22 +0000</pubDate>
		<dc:creator><![CDATA[zhangc]]></dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[水平居中]]></category>

		<guid isPermaLink="false">http://zhoumo123.cn/?p=225</guid>
		<description><![CDATA[使用DIV CSS 如何水平居中？很容易实现，水平居中使用  margin:0 auto;  &#160; 代码如下： 居中的div必须设置宽度，达到浏览器兼容性 代码头部必须有 文档声明  “&#60;!doctype html&#62;” ，添加 &#60;!DOCTYPE&#62; 声明，这样浏览器才能获知文档类型。]]></description>
				<content:encoded><![CDATA[<p>使用DIV CSS 如何水平居中？很容易实现，水平居中使用  <strong>margin:0 auto; </strong></p>
<div id="attachment_226" style="width: 387px" class="wp-caption alignnone"><a href="http://img.zhoumo123.cn/wp-content/uploads/div-css-center.jpg"><img class="wp-image-226 size-full" title="div css 实现div水平居中" src="http://img.zhoumo123.cn/wp-content/uploads/div-css-center.jpg" alt="div-css-center" width="377" height="261" /></a><p class="wp-caption-text">水平居中 效果图</p></div>
<p>&nbsp;</p>
<p>代码如下：</p>
<pre class="brush: java; title: ; notranslate">

&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;gb2312&quot;&gt;
&lt;title&gt;div css 水平居中&lt;/title&gt;
&lt;style&gt;
body{ font-size:12px; font-family:&quot;Microsoft Yahei&quot;;}
.w{margin-top:50px;}
.box{ width:300px;/*必须设置宽度*/ height:200px; background:#CCC; margin:0 auto; }
.tit{ text-align:center; padding-top:70px; font-size:16px;}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;div class=&quot;w&quot;&gt;
        &lt;div class=&quot;box&quot;&gt;
            &lt;div class=&quot;tit&quot;&gt;div css 水平居中 &lt;br&gt;zhoumo123.cn&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

</pre>
<p>居中的div必须设置宽度，达到浏览器兼容性 代码头部必须有 文档声明  “&lt;!doctype html&gt;” ，添加 &lt;!DOCTYPE&gt; 声明，这样浏览器才能获知文档类型。</p>
]]></content:encoded>
			<wfw:commentRss>http://zhoumo123.cn/web/css/225.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
