疯狂html5讲义(一):HTML5简介

1.在html发展历史中,最广为人知的是html3.2和html4.01.

2.将html与xml的长处加以结合,从而得到xhtml,xhtml是更严格、更纯净的html代码。

3.W3C组织使用DTD(Document Type Definition,文档类型定义)来定义html和xhtml的语义约束,包括出现那些元素,支持哪些属性。

4.html5是规范制定者对现实的妥协。

5.HTML5的优势

    1>主流浏览器:IE(9)、chrome、firefox(firefox4)、opera(opera10)、safari(safari5)

    2>部分替代了原来的js:如自动获取焦点:<input type=text autofocus name=price>

    3>更明确的语义支持:代替清一色的div页面结构

    <!DOCTYPE HTML> 
      
    <html> 
      
        <head> 
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
            <title>Website Title</title> 
        </head> 
      
        <body> 
      
           <strong> <header> 
                <nav></strong> 
                    <ul> 
                        <li>Home</li> 
                        <li>Contact</li> 
                    </ul> 
               <strong> </nav> 
            </header> 
      
            <section> 
      
                <article> </strong>
                    <header> 
                        <h2>Title Goes here</h2> 
                        <p>Posted on <time datetime="2012-07-28T13:00:24+01:00">July 28th 2012</time> by <a href="#">Author</a> - <a href="#comments">12 comments</a></p> 
                    </header> 
                    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> 
               <strong> </article> 
      
                <article></strong> 
                    <header> 
                        <h2>Article title</h2> 
                        <p>Posted on <time datetime="2012-07-26T13:00:24+01:00">July 26th 2012</time> by <a href="#">Author</a> - <a href="#comments">9 comments</a></p> 
                    </header> 
                    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> 
                <strong></article> 
      
            </section> 
      
            <aside> </strong>
                <h2>Contact Us</h2> 
                <p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.</p> 
           <strong> </aside> 
      
            <footer></strong> 
                <p>Copyright 2012 DigiMantra Labs ?</p> 
           <strong> </footer> </strong>
      
        </body> 
      
    </html> 

 上述<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 可以简化为<meta  charset="UTF-8" /> 

<em>元素表示被强调,可以用以下:

<time>2014-08-02</time>

<mark>被标记的文本</mark>

    4>增强了web应用程序的功能

6.html5的基本结构:

   <! DOCTYPE html>: DTD定义

   基本结构像5.3>代码所示

7.html5的语法变化

     1>标签不再区分大小写

     2>元素可以省略结束标签

                           eg:img、input、hr、embed、link、p、tr、td、th、thead、tbody等,可以省略全部标签的元素:html、head、body、tbody。

     3>可以省略属性值得属性 

                           eg:selected、disabled、checked、readonly、multiple、nowrap等

     4>允许属性值不使用引号(含有空格等容易引起浏览器混淆的属性值建议用引号)

8.注意:

               不要在<html>和<head>之间插入任何内容!

               不要在</head>和<body>之间插入任何内容!

               不要在</body>和</html>之间插入任何内容!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值