Table of Contents
第十六章
第十七章
第十八章
Home Web Front-end HTML Tutorial 《HTML5与CSS3基础教程》学习笔记 --Four Day_html/css_WEB-ITnose

《HTML5与CSS3基础教程》学习笔记 --Four Day_html/css_WEB-ITnose

Jun 24, 2016 am 11:21 AM

第十六章

1、    输入和元素

电子邮件框

搜索框
电话框
URL 框
以下元素得到了部分浏览器的支持
日期

数字
范围
数据列表

<input type="text" name=" "  list="fruit" /><datalist><option> </option><option> </option><option> </option></datalist>
Copy after login

下面的输入或者元素得到的支持很少, W3C 指出它们在 2014 年定案之时很可能不会列入 HTML5
颜色

全 局 日 期 和时间
局部日期和时间

时间

输出

2、 属性:

1) accept限制用户可上传文件的类型

2) autocomplete如果对 form 元素或特定的字段添加

3) autocomplete="off",就会关闭浏览器的对该表单或该字段的自动填写功能。默认值为 on

4) autofocus页面加载后将焦点放到该字段

5) multiple允许输入多个电子邮件地址,或者上传多个文件

6) list将 datalist 与 input 联系起来

7) maxlength指定 textarea 的最大字符数(在 HTML5 之前的文本框就支持该特性)

8) pattern定义一个用户所输入的文本在提交之前必须遵循的模式placeholder 指定一个出现在文本框中的提示文本,用户开始输入后该文本消失

9) required需要访问者在提交表单之前必须完成该字段

10) formnovalidate 关闭 HTML5 的自动验证功能。应用于提交按钮 novalidate关闭 HTML5 的自动验证功能。应用于表单元素

3、 可以增加来添加标题

4、

eg:

 <p class="row"><label for="first-name"> First Name:</label><input type="text" id="first-name"  name="first_name"  class="field-large" /></p>
Copy after login

5、 命名习惯:for、id、name

1) 单个单词:三个一致

2) 多个单词:for、id用-隔开,name用_隔开

6、 文本框

eg

<textarea id="bio" name="bio" cols="40" rows="5" class="field-large"></textarea>
Copy after login

7、 对选择框选项进行分组:

eg:

<select id="referral" name="referral"><optgroup label=" "><option value=" "> </option><option value=" "> </option></optgroup><optgroup label=" "><option value=" "> </option><option value=" "> </option></optgroup></select>
Copy after login

8、 让访问者上传文件:enctype="multipart/form-data"

<form method="post"action="show-data.php"  enctype="multipart/form-data">
Copy after login

9、 创建隐藏字段:type=”hidden”

1) name=”提交给服务器的信息”

2) value=”要提交的信息本身”

10、 根据状态为表单设置样式

第十七章

1、 视频文件格式:.ogg、.mp4、.webm

2、 video属性

1) src(源) 指定视频文件的URL

2) autoplay(自动播放) 当视频可以播放时立即开始播放

3) controls(控件) 添加浏览器为视频设置的默认控件

4) muted(静音) 让视频静音

5) loop(循环) 让视频循环播放

6) poster(海报) 指定视频加载时要显示的图像(而不显示视频的第一帧)。接受所需图像文件的 URL

7) width(宽度) 视频的宽度(以像素为单位),通常默认为 300

8) height(高度) 视频的高度(以像素为单位),通常默认为 150

9) preload(预加载) 告诉浏览器要加载的视频内容的多少。可以是以下三个值:

‰ none表示不加载任何视频

metadata 表示仅加载视频的元数据(如长度、尺寸等)
‰ auto

3、 添加控件和自动播放:controls、autopaly

4、 循环播放:loop

5、 海报图像:poster=”xx.jpg”

6、 防止预先加载视频:preload=”none/auto/metadata(最好)”

7、 使用多种来源的视频和备用文本(音频还没有加载出来显示文本)

eg:

<video width="369" height="208" controls><source src="paddle-steamer.mp4"  type="video/mp4"><source src="paddle-steamer.webm" type="video/webm"><p><a href="paddle-steamer.mp4">Download the video</a></p></video>
Copy after login

8、 音频格式:.ogg/.mp3/.wav/.aac/.mp4/opus

9、 添加音频:

10、 音频属性

11、 提供带备用内容的多个视频源

1)        <script src="build/jquery.js"> </script><script src="build/mediaelement-and- player.min.js"></script><link rel="stylesheet" href="build/ mediaelementplayer.min.css" />2)        <!-- 下面的代码放在所有内容之后 --><script>$('audio/video').mediaelementplayer();</script>
Copy after login

 

 

第十八章

1、  scope=”col/row” 列/行的标题单元格

2、  跨越多行和多列rowspan/colspan=”n”

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

What is the viewport meta tag? Why is it important for responsive design? What is the viewport meta tag? Why is it important for responsive design? Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

How do I use HTML5 form validation attributes to validate user input? How do I use HTML5 form validation attributes to validate user input? Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

How do I use the HTML5 <time> element to represent dates and times semantically? How do I use the HTML5 <time> element to represent dates and times semantically? Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 &lt;time&gt; element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

What are the best practices for cross-browser compatibility in HTML5? What are the best practices for cross-browser compatibility in HTML5? Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

The article discusses the &lt;iframe&gt; tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

See all articles