HTML5基础-新增标签+新增属性+布局案例

html5中常用的结构标签

article 文章

header 头部

nav 导航

section 区域

aside 侧边栏

hgroup 区块的相关信息

figure 定义一组内容及标题

figcaption 定义figure元素的标题

footer 底部

dialog 对话框

使用习惯:

header/section/footer > aside/article/figure/hgroup/nav > div

 

 

embed可插入flash文件,但flash已经逐渐被淘汰,不建议使用

 

 

meter状态标签,可以定义电压

optimum是标准状态

low与high之间呈现绿色,其余呈现黄色

<meter value=”220” min=”20” max=”380” low=”200” high=”240” optimum=”220”></meter>

自动计算百分比

="0.75">75%</>

有步长的进度条

progress ="30" max="100"progress>

不断加载的进度条

>

datalist为input定义下拉列表

<!DOCTYPE html>
html lang="en"head>
    meta charset="UTF-8"title>demobodyinput placeholder="请选择手机品牌" list="phoneList"datalist id>
        option ="iphone">iphoneoption="samsung">samsung="huawei">huawei="oppo">oppo="htc">htcdatalisthtml>

 

 

details定义元素的详细内容,配合summary

detailssummary>HTML5p>HTML5是构建Web内容的一种语言描述方式。HTML5是互联网的下一代标准,是构建以及呈现互联网内容的一种语言方式.被认为是互联网的核心技术之一。HTML产生于1990年,1997年HTML4成为互联网标准,并广泛应用于互联网应用的开发。
HTML5是Web中核心语言HTML的规范,用户使用任何手段进行网页浏览时看到的内容原本都是HTML格式的,在浏览器中通过一些技术处理将其转换成为了可识别的信息。HTML5在从前HTML4.01的基础上进行了一定的改进,虽然技术人员在开发过程中可能不会将这些新技术投入应用,但是对于该种技术的新特性,网站开发技术人员是必须要有所了解的。 [1-2] >

 

 

ruby和rt进行拼音的注释


    我们来ruby>rt>kuang一个话题
>

 

 

兼容浏览器的写法:

rp>(><>Kuang>)>

mark黄色选中效果

>妈妈叫我回家的时候顺路买一盒mark>牛奶>,需要很新鲜的那种。>

 

 

output表单计算

form oninput="sum.value=parseInt(num1.value)*parseInt(num2.value)"type="number" id="num1"*
        ="num2"=
        output name="sum" for="num1 num2"outputform>

 

 

date pickers在移动端效果比较好

week兼容性不好

datetime兼容性不好,推荐用datetime-local

time用来设置时间(小时和分钟);

month用来设置年和月;

date用来设置年月日;

datetime用来设置年月日和时间;


    email:="email" name="email"br
    url:="url"="url"
    tel:="tel"="tel"
    number:="number"

    date:="date"="date"
    month:="month"="month"
    week:="week"="week"
    time:="time"="time"
    datetime:="datetime"="datetime"
    datetime-local:="datetime-local"="datetime-local"

    range:="range" min="1"="10"
    search:="search"="search"
    color:="color"="color">

>

 

 

autocomplete属性规定form或input域拥有自动完成功能,该属性适用于<form>标签和<input>标签

autofocus自动获取焦点

multiple多选,适用于email和file,email中不同邮箱用,隔开

action="lesson2_1 autocomplete.html" autocomplete="on"="text" autofocus="autofocus" placeholder="您好,请在这里输入您的用户名!"="off" multiple="multiple"="file"="submit">

 

 

<link>标签中,sizes属性可以规定被链接资源的尺寸的大小

link rel="icon" href="icon.gif" type="image/gif" sizes="16x16"base href="http://localhost" target="_blank">

script:

defer 页面已完成加载后再执行脚本

async 一旦脚本可用,则异步执行

script async="async"="text/javascript" src="async.js"scriptdefer="defer"="defer.js">

ol有序列表倒序

>Olol start="2" reversed="reversed"li>Html>Html5>Css>Css3>JavaScriptol>

 

 

html页面布局demo:

demo.html
----------------------------------------
>html5="stylesheet"="style.css">

    headerdiv class="container">
            a ="index.html"img src="images/logo.png"anav>
                ="active">Home="#">Course>Actual>Plan>FAQ>Notesdivsection ="banner"ulli ="active"="images/banner/banner1.jpg"="left"="images/banner/banner3.jpg"="right"="images/banner/banner2.jpg"section="main"asideh1>Recent sampdldt>Hyper Text Markup Languagedd="images/Course/05_05.png">HTML is the standard markup language used to create web pages and its elements form the building blocks of all websites.>Cascading Style Sheets="images/Course/06_04.png">Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g.,fonts,colors,spacing) to Web documents.="images/Course/09_07.png">JavaScript is a high-level,dynamic,untyped,and interpreted programming language.>AngularJS="images/Course/02_09.png">AngularJS is an open-source web application framework mainly maintained by Google and by a community of individuals and...article>Welcome to >Massive Open Online Course!>We provide the latest knowledge to help you cope with the changing world!="images/article.jpg">We hope that all the students who love the Internet can be more convenient access to learning resources,using the Internet thinking to change our learning.>Focus on IT skills education MOOC,consistent with the development trend of the Internet down to earth's MOOC. We are free,we only teach useful,we concentrate on education.footer>Copyright © 2019 test.com All Rights Reserved.span="images/icon/weichat.png"="images/icon/sina.png"="images/icon/qq.png">
style.css
------------------------------------------

/* All tag */
* { font-family: Arial; font-size: 14px; margin: 0; padding: 0; border: none; }
a { text-decoration: none; }
ul { list-style: none; }

/* header */
header { position: relative; height: 80px; background: #000; }
header:after { position: absolute; bottom: 0; left: 0; width: 100%; height: 7px; content: ''; background: #d6d6d6; }
header > .container { position: relative; z-index: 1; width: 1200px; margin: 0 auto; }
header > .container > a { display: block; float: left; margin: 5px 25px; }
header > .container > nav { float: right; }

/* nav */
nav > a { font-size: 24px; line-height: 73px; display: block; float: left; width: 110px; height: 73px; text-align: center; color: #fff; }
nav > a:nth-child(1) { background: #433b90; }
nav > a:nth-child(2) { background: #017fcb; }
nav > a:nth-child(3) { background: #78b917; }
nav > a:nth-child(4) { background: #feb800; }
nav > a:nth-child(5) { background: #f27c01; }
nav > a:nth-child(6) { background: #d40112; }
nav > a:hover,nav > a.active { padding-bottom: 7px; }

/* banner */
.banner { position: relative; background: #eaeaea; }
.banner:after { position: absolute; bottom: 0; left: 0; width: 100%; height: 6px; content: ''; background: #d6d6d6; }
.banner > ul { position: relative; width: 1490px; height: 538px; margin: 0 auto; padding-top: 10px; }
.banner > ul > li { position: absolute; width: 610px; height: 300px; overflow: hidden; }
.banner > ul > li.active { z-index: 2; top: 37px; right: 0; left: 0; width: 960px; height: 460px; margin: auto; border: 1px solid #fff; box-shadow: 0 30px 140px 22px rgba(0,.35); }
.banner > ul > li.left { z-index: 1; top: 0; bottom: 0; left: 0; margin: auto; box-shadow: 0 3px 7px 0 rgba(0,.35); }
.banner > ul > li.right { z-index: 1; top: 0; right: 0; bottom: 0; margin: auto; box-shadow: 0 3px 7px 0 rgba(0,.35); }
.banner > ul > li > img { position: absolute; left: -30%; height: 100%; }

/* main */
.main { position: relative; width: 1200px; height: 473px; margin: 34px auto 0; }
.main h1 { font-size: 30px; font-weight: lighter; margin-bottom: 23px; }
.main h1 > samp { font-size: 30px; color: #7c7c7c; }
.main > aside { float: left; width: 450px; }
.main > aside > dl { position: relative; display: block; height: 74px; margin-bottom: 17px; }
.main > aside > dl > dt { position: absolute; top: -1px; left: 92px; font-size: 16px; font-weight: bold; line-height: 16px; text-decoration: underline; }
.main > aside > dl > dd:first-of-type { position: absolute; left: 0; }
.main > aside > dl > dd:last-of-type { position: absolute; top: 20px; left: 90px; }
.main > article { float: right; width: 720px; overflow: hidden; }
.main > article > p,.main > article > img { margin-bottom: 20px; }

/* footer */
footer { position: relative; background: #000; }
footer:before { position: absolute; z-index: -1; top: -6px; left: 0; width: 100%; height: 6px; content: ''; background: #d6d6d6; }
footer > .container { width: 1200px; height: 64px; margin: 0 auto; }
footer > .container > p { line-height: 64px; float: left; color: #fff; }
footer > .container > span { float: right; margin: 14px 40px; }
footer > .container > span > img { margin-left: 4px; opacity: .7; }
footer > .container > span > img:hover { opacity: 1; cursor: pointer; }

 

 

html页面布局demo2:

>html="demo.css"table ="outer-table"<!-- 顶部 -->
        theadtrtd="img/logo.png" alt="logo" 主体 tbody>    
                    table>
                        >
                             左侧 -->
                            td width="12%">
                                p ="left-p">
                                    >商品管理>评价管理>咨询管理b>全部订单>已完成订单>待处理订单>今日物流>月考核>季度考核>年度考核 右侧 ="88%"="inner-table">
                                        >
                                            
                                                查询:
                                                ="order" class="inner-table" rules="all"colspan="2">宝贝信息>订单数量>单价>买家>下单时间>实付款>订单操作="img/txue.png">2019新款个性男女潮牌&暮春之行文化衫>2>120>小明>2019-2-21 21:54>240>待付款>
                     页脚 tfoot>2019-12-29 &copy;test.comdemo.css
-----------------------------------

*{margin:0;padding:0;}
table{width:100%;background-color: #fff;}
#outer-table{background-color: #abcdef;}
#outer-table tfoot td{text-align:center;height:50px;line-height: 50px;}
#outer-table img{width: 150px;margin-left: 10px;}
.left-p{margin-left:10px;margin-top:-250px;}
.left-p span{line-height:2em;}
.inner-table{border:2px solid #ccc;}
.inner-table tr td{padding:10px;}
#order tr td{text-align:center;}
#order tr td img{width:50px;}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


HTML代码中要想改变字体颜色,常常需要使用CSS样式表。CSS是一门用来描述网页上样式的语言,通过编写CSS代码可以实现网页中各元素的大小、颜色、字体等各种样式的控制。那么如何在HTML代码中应用CSS样式来改变字体颜色呢?这里为大家介绍一下。 首先,在HTML代码...
HTML代码如何让字体盖住图片呢?需要使用CSS的position属性及z-index属性。 img { position: relative; z-index: -1; } p { position: absolute; to...
HTML代码字体设置 在HTML中,我们可以使用标签来设置网页中的文字字体。常用的字体标签是font和style,下面我们来学习如何使用这些标签。 1. font标签 使用font标签可以改变文字的字体、颜色和大小。它有三个属性font-family、color和...
在网页设计中,HTML代码的字体和字号选择是非常重要的一个环节,因为它们直接关系到页面的可读性和视觉效果。 要指定文本的字体和字号,可以使用HTML中的样式属性。使用样式属性设置字体和字号,如下所示: <p style="font-family: Aria...
HTML(Hypertext Markup Language,超文本标记语言)是一种用于创建网页的标准语言。它由许多标签(一对尖括号包围的关键字)组成,这些标签告诉浏览器如何显示内容。使用HTML代码,我们可以轻松地创建各种类型的图像和图形,如太极图。 在HTM...
外链是指在一个网页中添加一个指向其他网站的链接,用户可以通过这个链接直接跳转到其他网站。在HTML中,实现外链的方法很简单,只需要使用标签就可以了。 <a href="http://www.example.com">这是一个外链,点击跳转到www.ex...
HTML代码是实现网页界面的基础,而网页中的各种表单则是用户和网站进行交互的重要方式之一。下面我们来介绍如何使用HTML代码实现一个简单的报名表格。 <form action="submit.php" method="post"> &lt...
HTML是一种标记语言,用于开发网站和其他互联网内容。字体是网站设计中的关键元素之一,它可以决定网站的整体风格和呈现效果。HTML提供了字体编辑器,使网站设计变得更加容易。 <font face="Arial"> 这里是Arial字体 &...
HTML代码中,字体样式是开发者们必备的一部分。在HTML中,我们可以通过特定的标签和属性设置字体的样式、颜色和大小,以达到更好的排版效果。 <p style="font-size: 14px; color: #333; font-family:...
HTML中的字体可以设为粗体,以强调文本信息。我们可以通过使用一些标签来实现这一功能。其中,常用的标签包括: 1. 标签:该标签会把文本加粗显示,语法如下: 这是一段加粗的文本 2. 标签:与标签作用相同,但语义更强,表示该文本内容的重要性。语法如下:...
HTML代码可以实现文件的上传和下载,在网页开发中相当常见。通过使用<input>标签和<form>标签,我们可以轻松创建一个文件上传表单。 <form action="upload.php" method="post" enct...
HTML代码非常常见于网页设计中。在一些需要处理时间相关数据的场景下,可能需要将时间戳转换为实际时间,这时候就需要使用一些特定的HTML代码。 function timeStamp2Time(time){ var date = new Date(time...
HTML是一种用于创建网页的标记语言。在HTML中,我们可以使用超链接标签实现下载文件到本地的功能。 具体实现步骤如下: <a href="文件的URL" download="文件名">下载文件</a> 其中,href属性是文件...
在HTML代码中,对于字体靠左对齐有各种方法。其中最简单的方式之一是使用pre标签。 使用pre标签可以保留一段文本中的空格和换行符,从而使代码排版更加整齐。下面是一个例子: <p>这是一个段落。</p> &lt...
HTML代码字典是一本解释HTML标记和属性的参考文献。这本字典中包含了最常用的HTML代码以及它们的属性和值的详细描述。 例如,以下是HTML代码字典中的一部分内容: <a href="url">link text</a> 在...
在网页开发过程中,遇到一些需要用户复制的内容,我们通常都会提供复制按钮,让用户更方便地复制所需内容。下面我们来介绍如何使用html代码实现一键复制的功能。 var copyBtn = document.querySelector('#copy-bt...
用户登录 欢迎来到公司登录界面,请输入用户名和密码登录 用户名: 密码: 代码解释: 第1行:定义了一个 HTML 文档 第2行:开始了 HTML 头部 第3行:定义了...
HTML 代码是用来创建网页的语言,它包含了许多不同的元素和属性,让我们可以在网页中添加各种不同的元素和内容,如文字、图片、链接等等。在编写 HTML 代码时,我们可以使用各种不同的样式来美化我们的网页,例如更改字体、颜色、大小等等。 font-family:...
HTML代码中的字体转移 在编写HTML代码时,我们经常会使用各种字体来增强页面的可读性和视觉效果。但是,有些字符或特殊符号可能会在HTML中具有不同的含义,这就需要使用字体转义转换成HTML可以正常显示的字符。 在HTML中,使用"&"符号表示一个特殊字符将要被转...
HTML 编程语言中,你可以使用字体属性来更改文本的字体大小、颜色和样式。其中,字体颜色是最常用的样式更改。在 HTML 中,你可以使用 "color" 属性来更改文本的颜色。下面是一个使用 "pre" 标签的代码示例,演示如何使用 "color" 属性来更改字体颜色...