HTML5学习笔记——基本语法和语义

<!DOCTYPE html>
<!--文档类型声明:DOCTYPE是不区分大小写的,可以对字符随意的使用大小写-->
<HTML lang="en">
<!--指定语言-->
<HEAD>
<META charset="UTF-8" />
<!--指定字符集-->
<TITLE>HTML5,for Fun &amp;Profit</TITLE>
<link rel="stylesheet" href="styles.css" />
<script src="scripts.js"></script>
<!--IE9之前样式化结构性元素-->
<script>
    document.createElement('header');
    document.createElement('footer');
    document.createElement('nav');
    document.createElement('article');
    document.createElement('aside');
    document.createElement('section');
</script>
</HEAD>
<BODY>

<!-- Insert HTML here -->
<header>
    <h1><abbr title="Hypertext Markup Language">HTML</abbr>5,for <abbr title="Hypertext Markup Language">Fun</abbr> &amp;Profit</h1>
    <nav>
        <ul>
            <li><a href="/Archive/">Archive</a></li>
            <li><a href="/About/">About</a></li>
        </ul>
    </nav>
</header>
<details>
    <summary>Upcoming Topics</summary>
    <p>For the new year,we have a great line up of articles!</p>
    <ul>
        <li>Understandinng the Outline Algorithm</li>
        <li>When to Use <code>hgroup</code></li>
        <li>Machine Semantics with Microdata</li>
    </ul>
</details>
<!--控制列表的编号-->
<ol start="1">
    <li>Apples</li>
    <li>Oranges</li>
    <li>Bananas</li>
</ol>
<!--顺序翻转-->
<ol reversed>
    <li>Apples</li>
    <li>Oranges</li>
    <li>Bananas</li>
</ol>
<!--为每个li指定具体数字-->
<ol>
    <li value="1">Apples</li>
    <li value="1">Oranges</li>
    <li value="2">Bananas</li>
</ol>
<!--隐藏内容以稍后显示-->
<p hidden>As a special deal for members,use discount code AWESOMESAUCE and save 10% off all purchases from these vendors.</p>

<!--nav只适用于主要的站点导航,而不适合搜索结果链接或友情链接-->
<!--让页面的一部分可编辑-->
<article contenteditable>
    <h2>Stop <code>section</code> Abuse! </h2>
    <p>As the most generic of the HTML5 structural elements,<code>section</code>
    is often incorrectly used as a styling container,when<code> div </code> is more appropriate.</p>
</article>
<!--设置本地拖放-->
<h2 draggable>Block-Level Links</h2>
<article>
    <h2><code>nav</code>Is not for <em>ALL</em> Links</h2>
    <p>Though the <code>nav</code> element often contains links,that does not mean that <em>all</em> links on a site need <code> nav </code>.</p>
</article>
<abbr title="Accessible Rich Internet Applications">ARIA</abbr>
<section>
<article>
    <h2><code>nav</code>Is not for <em>ALL</em> Links</h2>
    <p>Though the<code>nav</code> element often contains links,that does not mean that <em>all</em> links on a site need <code> nav </code>.</p>
</article>
<figure>
    <img src="chart.bmp" alt="Chart of increasing awesomeness" />
    <figcaption>The incresing amount of awesome that this blog demonstrayes.</figcaption>
</figure>
</section>
<!--只有时间-->
<p>Published:<time datetime="2011-01-15">January 15,2011</time></p>
<!--只有时间-->
<p>The class starts at <time datetime="08:00">8:00 am</time>.</p>
<!--日期和时间-->
<p>Registration opens on <time datetime="2011-01-15T08:00-07:00">January 15,2011 at 8:00 am,Moutain Time</time>.</p>
<!--可见的机器可读格式(datetime不是必须的)-->
<p>Published:<time>2011-01-15</time></p>
<!--设置本地扩展和折叠功能,目前仅Chrome支持-->

<footer>
    <p>Copyright &copy;2011<a href="http://jtml5funprofit.com">HTML5,for Fun &amp;Profit</a>.All rights reserved.</p>
</footer>
</BODY>
</HTML>

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值