提示:这里可以添加系列文章的所有文章的目录,目录需要自己手动添加
例如:第一章 Python 机器学习入门之pandas的使用
提示:写完文章后,目录可以自动生成,如何生成可参考右边的帮助文档
这里开始记录HTML5的学习笔记
| 标签 | 语义 |
|---|---|
| article | 定义页面独立的内容区域 |
| aside | 定义页面的侧边栏内容 |
| bdi | 允许您设置一段文本,使其脱离其父元素的文本方向设置。 |
| command | 定义命令按钮,比如单选按钮、复选框或按钮 |
| details | 用于描述文档或文档某个部分的细节 |
| dialog | 定义对话框,比如提示框 |
| summary | 标签包含 details 元素的标题 |
| figure | 规定独立的流内容(图像、图表、照片、代码等等) |
| figcaption | 定义 figure 元素的标题 |
| footer | 定义 section 或 document 的页脚 |
| header | 定义了文档的头部区域 |
| mark | 定义带有记号的文本 |
| meter | 定义度量衡。仅用于已知最大和最小值的度量 |
| nav | 定义运行中的进度(进程) |
| progress | 定义任何类型的任务的进度 |
| ruby | 定义 ruby 注释(中文注音或字符) |
| rt | 定义字符(中文注音或字符)的解释或发音 |
| rp | 在 ruby 注释中使用,定义不支持 ruby 元素的浏览器所显示的内容 |
| section | 定义文档中的节(section、区段) |
| time | 定义日期或时间 |
| wbr | 规定在文本中的何处适合添加换行符 |
<header>header>
<footer>footer>
<nav>nav>
<section>section>
文件地址如下:
https://download.csdn.net/download/qq_35112578/86781995
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">

DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>HTML5的input type属性title>
head>
<body>
<form action="" for="email">
email: <input type="email" name="" id="email" />
<input type="submit" value="提交email" />
form><hr>
<form action="" for="tel">
tel: <input type="tel" name="" id="tel" />
<input type="submit" value="提交tel" />
form><hr>
<form action="" for="url">
url: <input type="url" name="" id="url" />
<input type="submit" value="提交url" />
form><hr>
<form action="" for="number">
number: <input type="number" name="" id="number" />
<input type="submit" value="提交number" />
form><hr>
<form action="" for="search">
search: <input type="search" name="" id="search" />
<input type="submit" value="提交search" />
form><hr>
<form action="" for="range">
range: <input type="range" name="" id="range" />
<input type="submit" value="提交range" />
form><hr>
<form action="" for="time">
time: <input type="time" name="" id="time" />
<input type="submit" value="提交time" />
form><hr>
<form action="" for="date">
date: <input type="date" name="" id="date" />
<input type="submit" value="提交date" />
form><hr>
<form action="" for="date">
datetime: <input type="datetime" name="" id="datetime" />
<input type="submit" value="提交datetime" />
form><hr>
<form action="" for="month">
month: <input type="month" name="" id="month" />
<input type="submit" value="提交month" />
form><hr>
<form action="" for="week">
week: <input type="week" name="" id="week" />
<input type="submit" value="提交week" />
form><hr>
body>
html>

<style>
/* 改变占位符placeholder的样式 */
#ph::-webkit-input-placeholder {
color: red;
}
style>
<form action="" for='ph'>
<input type="text" placeholder="我是占位符" id='ph'>
<input type="submit">
form>

<form action="" for='search'>
<input type="search" id='search' autofocus>
<input type="submit">
form>

<form action="" for='file'>
<input type="file" id='file' multiple>
<input type="submit">
form>
<hr>
有两个属性值,on和off,on表示记录已经输入的值,必须有提交按钮,并且表单必须有名字
如果此项不填会提示内容不能为空
"off"属性表示首字母不大写
html

localStorage.setItem("name1", "zhangsan")
localStorage.name2 = "lisi"
localStorage["name3"]="wangwu"
// 读取、获得 值
let name1=localStorage.getItem("name1")
console.log(name1);
let name2=localStorage.name2
console.log(name2);
let name3=localStorage["name3"]
console.log(name3);
运行结果如下:

// 指定删除 remove
localStorage.removeItem("name1")
// 全部删除 clear()
localStorage.clear()
sessionStorage.setItem("name1", "zhangsan")
sessionStorage.name2 = "lisi"
sessionStorage["name3"]="wangwu"
// 读取、获得 值
let name1=sessionStorage.getItem("name1")
console.log(name1);
let name2=sessionStorage.name2
console.log(name2);
let name3=sessionStorage["name3"]
console.log(name3);
// 指定删除 remove
sessionStorage.removeItem("name1")
// 全部删除 clear()
sessionStorage.clear()
// value值的转化
localStorage.setItem('a',999)
console.log('a转化前:'+ typeof localStorage.getItem('a'));
console.log('a转化后:'+ typeof JSON.parse(localStorage.getItem('a')) );
以上就是今日学习的HTML5的新内容。