What are the knowledge points that must be mastered in HTML?

王林
Release: 2020-11-10 16:05:37
forward
2637 people have browsed it

What are the knowledge points that must be mastered in HTML?

How do you understand HTML semantics?

Learning video sharing: html video tutorial

Make the page content structured, it has the following advantages

1. Easy for users to read, the style is lost This will give the page a clear structure.

2. It is beneficial to SEO. Search engines determine the context and the weight of each keyword based on the tags.

3. Convenient for other devices to parse, such as blind readers rendering web pages based on semantics

4. Conducive to development and maintenance, semantics are more readable, codes are better maintained, and CSS3 The relationship is more harmonious

For example:

What are the knowledge points that must be mastered in HTML?

What is meta viewport used for and how to write it?

Usually viewport refers to the window and viewport. The area on the browser (or maybe a webview in an app) used to display the web page. The viewports on the mobile terminal and PC are different. The viewport on the PC is the browser window area, while on the mobile terminal there are three different viewport concepts: layout viewport, visual viewport, and ideal viewport

meta has two attributes name and http-equiv

1, name

keywords(关键字) 告诉搜索引擎,你网页的关键字
description(网站内容描述) 用于告诉搜索引擎,你网站的主要内容。
viewport(移动端的窗口) 后面介绍
robots(定义搜索引擎爬虫的索引方式) robots用来告诉爬虫哪些页面需要索引,哪些页面不需要索引
author(作者)
generator(网页制作软件)
copyright(版权)
Copy after login

2, http-equiv. As the name suggests, it is equivalent to the file header function of http

content-Type 设定网页字符集
//旧的HTML,不推荐
//HTML5设定网页字符集的方式,推荐使用UTF-8
X-UA-Compatible(浏览器采用哪种版本来渲染页面)
//指定IE和Chrome使用最新版本渲染当前页面
cache-control(请求和响应遵循的缓存机制)
expires(网页到期时间)
Copy after login

canvas canvas

const ctx = canvas.getContext(‘2d’); // 获取它的2d上下文
ctx.fillStyle = ‘green’; // 设置笔刷的填充色
ctx.fillRect(10, 10, 100, 100); // 利用画笔范围,矩形,比如圆
Copy after login

video

autoplay 布尔属性;视频马上自动开始播放,不会停下来等着数据载入结束。
controls 提供用户控制,允许用户控制视频的播放,包括音量,跨帧,暂停/恢复播放。
loop 布尔属性;指定后,会在视频结尾的地方,自动返回视频开始的地方。
track标签表示的是字幕
poster 表示的是封面
Copy after login

h5 mobile page

WebView是一种控件,它基于webkit引擎,因此具备渲染Web页面的功能。
基于Webview的混合开发,就是在 Anddroid (安卓)/(苹果)原生APP里,通过WebView控件嵌入Web页面。
很多APP都是外边套原生APP的壳,内容是H5页面(基于html+css+js的Web页面)。现在的移动端混合开发软件,如果对于交互渲染要求不是特别高的项目,基本都是这么玩的。
Copy after login

HTML5 new features

本地存储特性
设备兼容特性 HTML5提供了前所未有的数据与应用接入开放接口
连接特性 WebSockets
网页多媒体特性 支持Audio Video SVG Canvas WebGL CSS3
CSS3特性
Copy after login

Distinguish between ordinary display and high-definition screen

当devicePixelRatio值等于1时(也就是最小值),那么它普通显示屏。
当devicePixelRatio值大于1(通常是1.5、2.0),那么它就是高清显示屏。
不同像素的图利用媒体查询结合 devicePixelRatio 可以区分普通显示屏和高清显示屏
Copy after login

CSS design plan:

.css{/* 普通显示屏(设备像素比例小于等于1.3)使用1倍的图 */ 
    background-image: url(img_1x.png);
}
@media only screen and (-webkit-min-device-pixel-ratio:1.5){
	.css{/* 高清显示屏(设备像素比例大于等于1.5)使用2倍图  */
	    background-image: url(img_2x.png);
	  }
}
Copy after login

The server uses nginx to process the image

Cut the image of whatever size you want, we provide proportional scaling and custom size The cutting method is just to concatenate the string after the address.

The differences and characteristics of cookies, localStorage and SessionStorage

1. LocalStorage characteristics:

只保留在客户端
本地永久存储,关闭浏览器不会清除,除非用户从浏览器清除
每个域可以最多存储5MB
Copy after login

2. SessionStorage characteristics:

只保留在客户端
本地临时存储,在页面会话结束时会被清除
存储大小与localStorage相同
Copy after login

3. Cookie characteristics:

服务端和客户端都可以访问
可以设置有效期,过期后将会自动删除。如果不设置则是关闭浏览器后失效
存储大小只有4kb
有存储个数限制。每个浏览器限制不一样。建议20个以内。最多的浏览器可以支持50个
Copy after login

Related recommendations: html tutorial

The above is the detailed content of What are the knowledge points that must be mastered in HTML?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!