<?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; html5</title>
	<atom:link href="http://zhoumo123.cn/tag/html5/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>html5使用DeviceMotionEvent实现摇一摇</title>
		<link>http://zhoumo123.cn/web/html5/3394.html</link>
		<comments>http://zhoumo123.cn/web/html5/3394.html#comments</comments>
		<pubDate>Tue, 01 Dec 2015 05:45:36 +0000</pubDate>
		<dc:creator><![CDATA[zhangc]]></dc:creator>
				<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://zhoumo123.cn/?p=3394</guid>
		<description><![CDATA[&#60;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.01 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/html4/loose.dtd&#8221;&#62; &#60;html&#62; &#60;head&#62; &#60;meta http-equiv=&#8221;content-type&#8221; content=&#8221;text/html;charset=utf-8&#8243;&#62; &#60;title&#62; html5使用DeviceMotionEvent实现摇一摇  ...  <a href="http://zhoumo123.cn/web/html5/3394.html">  阅读全文 </a>]]></description>
				<content:encoded><![CDATA[<p>&lt;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.01 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/html4/loose.dtd&#8221;&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;content-type&#8221; content=&#8221;text/html;charset=utf-8&#8243;&gt;<br />
&lt;title&gt; html5使用DeviceMotionEvent实现摇一摇 &lt;/title&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
.center{position:absolute; width:640px; height:480px; left:50%; top:50%; margin-left:-320px; margin-top:-240px; line-height:480px; text-align:center; font-size:100px; }<br />
.normal{background:#000000;}<br />
.normal .txt{color:#FFFFFF;}<br />
.doing{background:#FF0000;}<br />
.doing .txt{color:#FFFF00;}<br />
&lt;/style&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body id=&#8221;mybody&#8221; class=&#8221;normal&#8221;&gt;<br />
&lt;div id=&#8221;txt&#8221; class=&#8221;txt center&#8221;&gt;请执行摇一摇&lt;/div&gt;<br />
&lt;/body&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
var doing = 0; // 判断是否在动画显示中<br />
var speed = 23; // 定义摇动的速度数值<br />
var lastx = 0;<br />
var lasty = 0;<br />
var lastz = 0;</p>
<p>function handleMotionEvent(event) {<br />
var x = event.accelerationIncludingGravity.x;<br />
var y = event.accelerationIncludingGravity.y;<br />
var z = event.accelerationIncludingGravity.z;</p>
<p>if(doing==0){<br />
if(Math.abs(x-lastx)&gt;speed || Math.abs(y-lasty)&gt;speed){<br />
doing = 1;<br />
show();<br />
}<br />
}</p>
<p>lastx = x;<br />
lasty = y;<br />
lastz = z;<br />
}</p>
<p>function show(){<br />
document.getElementById(&#8216;mybody&#8217;).className = &#8216;doing';<br />
document.getElementById(&#8216;txt&#8217;).innerHTML = &#8216;执行了摇一摇';<br />
setTimeout(function(){<br />
doing=0;<br />
document.getElementById(&#8216;mybody&#8217;).className=&#8217;normal';<br />
document.getElementById(&#8216;txt&#8217;).innerHTML = &#8216;请执行摇一摇';<br />
},3000);<br />
}</p>
<p>window.addEventListener(&#8220;devicemotion&#8221;, handleMotionEvent, true);<br />
&lt;/script&gt;</p>
<p>&lt;/html&gt;</p>
<p>&nbsp;</p>
<p>http://blog.csdn.net/fdipzone/article/details/50103027</p>
]]></content:encoded>
			<wfw:commentRss>http://zhoumo123.cn/web/html5/3394.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>手机访问页面字体变小，页面自适应屏幕的方法（meta中的viewport）</title>
		<link>http://zhoumo123.cn/web/html5/176.html</link>
		<comments>http://zhoumo123.cn/web/html5/176.html#comments</comments>
		<pubDate>Thu, 24 Jul 2014 11:00:15 +0000</pubDate>
		<dc:creator><![CDATA[zhangc]]></dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[viewport]]></category>

		<guid isPermaLink="false">http://zhoumo123.cn/?p=176</guid>
		<description><![CDATA[手机访问页面字体变小，页面自适应屏幕的代码 页面中加入代码： 这样手机访问就自适应屏幕了。不支持IE8以及低于IE8的浏览器。]]></description>
				<content:encoded><![CDATA[<p>手机访问页面字体变小，页面自适应屏幕的代码<br />
页面中加入代码：</p>
<pre class="brush: php; title: ; notranslate">
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
</pre>
<p>这样手机访问就自适应屏幕了。不支持IE8以及低于IE8的浏览器。</p>
]]></content:encoded>
			<wfw:commentRss>http://zhoumo123.cn/web/html5/176.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>article元素</title>
		<link>http://zhoumo123.cn/web/html5/18.html</link>
		<comments>http://zhoumo123.cn/web/html5/18.html#comments</comments>
		<pubDate>Tue, 20 May 2014 01:03:30 +0000</pubDate>
		<dc:creator><![CDATA[zhangc]]></dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[article元素]]></category>

		<guid isPermaLink="false">http://zhoumo123.cn/?p=18</guid>
		<description><![CDATA[article元素代表文档、页面或应用程序中独立的、完整的、可以独自被外部引用的内容。它可以是一篇博客或报刊中的文章、一篇论坛帖子、一段用户评论或独立的插件，或其他任何独立的内容。 除了内容部分，一个article元素通常有它自己的标题（一般放在一个header元素里面），有时还有自己的脚注。 现在，让我们以博客为例来看一段关于article元素的代码示例，如代码清单3-1所示。 代码清单3-1   article元素示例 这个示例是一篇讲述苹果的博客文章，在header元素中嵌入了文章的标题部分，在这部分中，文章的标题“苹果”被镶嵌在h1元素中，文章的发表日期镶嵌在p元素中。在标题下部的p元 ...  <a href="http://zhoumo123.cn/web/html5/18.html">  阅读全文 </a>]]></description>
				<content:encoded><![CDATA[<p>article元素代表文档、页面或应用程序中独立的、完整的、可以独自被外部引用的内容。它可以是一篇博客或报刊中的文章、一篇论坛帖子、一段用户评论或独立的插件，或其他任何独立的内容。</p>
<p>除了内容部分，一个article元素通常有它自己的标题（一般放在一个header元素里面），有时还有自己的脚注。</p>
<p>现在，让我们以博客为例来看一段关于article元素的代码示例，如代码清单3-1所示。</p>
<p><strong>代码清单3-1   article元素示例</strong></p>
<pre class="brush: java; title: ; notranslate">

&lt;article&gt;
    &lt;header&gt;
        &lt;h1&gt;苹果&lt;/h1&gt;
        &lt;p&gt;发表日期: &lt;time pubdate=&quot;pubdate&quot;&gt;2010/10/09&lt;/time&gt;&lt;/p&gt;
    &lt;/header&gt;
    &lt;p&gt;&lt;b&gt;苹果&lt;/b&gt; ，植物类水果，多次花果...（&quot;苹果&quot;文章正文）&lt;/p&gt;
    &lt;footer&gt;
        &lt;p&gt;&lt;small&gt;著作权归***公司所有。&lt;/small&gt;&lt;/p&gt;
    &lt;/footer&gt;
&lt;/article&gt;

</pre>
<p>这个示例是一篇讲述苹果的博客文章，在header元素中嵌入了文章的标题部分，在这部分中，文章的标题“苹果”被镶嵌在h1元素中，文章的发表日期镶嵌在p元素中。在标题下部的p元素中，嵌入了一大段该博客文章的正文，在结尾处的footer元素中，嵌入了文章的著作权，作为脚注。整个示例的内容相对比较独立、完整，因此，对这部分内容使用了article元素。</p>
<p>article元素是可以嵌套使用的，内层的内容在原则上需要与外层的内容相关联。例如，一篇博客文章中，针对该文章的评论就可以使用嵌套article元素的方式；用来呈现评论的article元素被包含在表示整体内容的article元素里面。</p>
<p>接着，让我们来看一个关于article元素嵌套的代码示例，如代码清单3-2所示。</p>
<p><strong>代码清单3-2   article元素嵌套示例</strong></p>
<pre class="brush: java; title: ; notranslate">
    &lt;article&gt; 
        &lt;header&gt; 
            &lt;h1&gt;苹果&lt;/h1&gt; 
            &lt;p&gt;发表日期:  
                   &lt;time pubdate datetime=&quot;2010/10/09&quot;&gt;2010/10/09&lt;/time&gt; 
            &lt;/p&gt; 
        &lt;/header&gt; 
        &lt;p&gt;&lt;b&gt;苹果&lt;/b&gt; ，植物类水果，多次花果...（&quot;苹果&quot;文章正文）&lt;/p&gt; 
        &lt;section&gt; 
            &lt;h2&gt;评论&lt;/h2&gt; 
            &lt;article&gt; 
                &lt;header&gt; 
                   &lt;h3&gt;发表者：陆凌牛&lt;/h3&gt; 
                   &lt;p&gt; 
                      &lt;time pubdate datetime=&quot;2010-10-10T19:10-08:00&quot;&gt; 
                          1小时前  
                      &lt;/time&gt; 
                   &lt;/p&gt; 
                &lt;/header&gt; 
                &lt;p&gt;我喜欢苹果，我最喜爱的品种是红富士。&lt;/p&gt; 
            &lt;/article&gt; 
            &lt;article&gt; 
                &lt;header&gt; 
                   &lt;h3&gt;发表者：张玉&lt;/h3&gt; 
                   &lt;p&gt; 
                      &lt;time pubdate datetime=&quot;2010-10-10T19:15-08:00&quot;&gt; 
                          1小时前  
                      &lt;/time&gt; 
                   &lt;/p&gt; 
                &lt;/header&gt; 
                &lt;p&gt;苹果？我不喜欢，我喜欢吃橘子。&lt;/p&gt; 
            &lt;/article&gt; 
        &lt;/section&gt; 
    &lt;/article&gt; 
</pre>
<p>这个示例中的内容比代码清单3-1中的内容更加完整了，它添加了文章读者的评论内容，示例的整体内容还是比较独立、完整的，因此对其使用article元素。具体来说，示例内容又分为几部分，文章标题放在了header元素中，文章正文放在了header元素后面的p元素中，然后section元素把正文与评论部分进行了区分（section元素马上就要讲到，是一个分块元素，用来把页面中的内容进行分块），在section元素中嵌入了评论的内容，评论中每一个人的评论相对来说又是比较独立、完整的，因此对它们都使用一个article元素，在评论的article元素中，又可以分为标题与评论内容部分，分别放在header元素与p元素中。</p>
<p>关于示例中提到的time元素与pubdate属性，请查看本节结尾处有关time元素与pubdate属性的说明。</p>
<p>另外，article元素也可以用来表示插件，它的作用是使插件看起来好像内嵌在页面中一样。代码清单3-3是它的一个示例。</p>
<p><strong>代码清单3-3   用article元素表示插件</strong></p>
<pre class="brush: java; title: ; notranslate">
    &lt;article&gt; 
        &lt;h1&gt;My Fruit Spinner&lt;/h1&gt; 
        &lt;object&gt; 
            &lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt; 
            &lt;embed src=&quot;#&quot; width=&quot;600&quot; height=&quot;395&quot;&gt;&lt;/embed&gt; 
        &lt;/object&gt; 
    &lt;/article&gt; 

</pre>
<p>&nbsp;</p>
<p><span style="color: #c0c0c0;">参考资料：HTML5 与 CSS3 权威指南</span></p>
]]></content:encoded>
			<wfw:commentRss>http://zhoumo123.cn/web/html5/18.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>html5新增的结构元素 section元素</title>
		<link>http://zhoumo123.cn/web/html5/8.html</link>
		<comments>http://zhoumo123.cn/web/html5/8.html#comments</comments>
		<pubDate>Mon, 19 May 2014 06:23:00 +0000</pubDate>
		<dc:creator><![CDATA[zhangc]]></dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[section元素]]></category>

		<guid isPermaLink="false">http://zhoumo123.cn/?p=8</guid>
		<description><![CDATA[section元素 section元素表示页面中的一个内容区块，比如章节、页眉、页脚或页面中的其他部分，它可以与h1、h2、h3、h4、h5、h6等元素结合起来使用，标示文档结构。 html5 中代码示例; &#60;section&#62; &#8230; &#60;/section&#62; html4中代码示例; &#60;div&#62; &#8230; &#60;/div&#62; &#160;  ]]></description>
				<content:encoded><![CDATA[<p><strong>section元素 </strong></p>
<p>section元素表示页面中的一个内容区块，比如章节、页眉、页脚或页面中的其他部分，它可以与h1、h2、h3、h4、h5、h6等元素结合起来使用，标示文档结构。</p>
<p>html5 中代码示例;</p>
<p>&lt;section&gt; &#8230; &lt;/section&gt;</p>
<p>html4中代码示例;</p>
<p>&lt;div&gt; &#8230; &lt;/div&gt;</p>
<p>&nbsp;</p>
<p><span style="color: #c0c0c0;"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://zhoumo123.cn/web/html5/8.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
