Home > Article > Web Front-end > Summary of knowledge about HTML5
This article brings you a summary of knowledge about HTML5. Friends who need it can refer to it. I hope it can help everyone. Let’s take a look with the editor below.
html { font-size: 100px; } @media(min-width: 320px) { html { font-size: 100px; } } @media(min-width: 360px) { html { font-size: 112.5px; } } @media(min-width: 400px) { html { font-size: 125px; } } @media(min-width: 640px) { html { font-size: 200px; } }
Set the font size of 100px for mobile phones; for 320px mobile phones, the matching is 100px,
Other mobile phones are matched proportionally; therefore, if there are many pixels on the design draft, then when converted to rem, rem = design draft Pixel/100 is enough;
When using the a tag as a button or text connection on the mobile terminal, a "dark" background will appear when clicking the button, such as the following code: <span style="font-size: 14px;"></span>##<pre class="brush:php;toolbar:false"><a href="">button1</a>
<input type="button" value="提交"/></pre>
<span style="font-size: 14px;"></span><pre class="brush:php;toolbar:false">a,button,input,optgroup,select,textarea{
-webkit-tap-highlight-color: rgba(0,0,0,0);
}</pre>
3. Meta basic knowledge points: <span style="font-size: 14px;"></span>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,maximum-scale=1.0, user-scalable=0" />
content=”width=device-width:
Control the size of the viewport, device-width is the width of the device
initial-scale - initial scaling
minimum-scale - The minimum scale the user is allowed to zoom to
maximum-scale - the maximum scale the user is allowed to zoom to
user-scalable - whether the user can manually scale
<meta name="format-detection" content="telephone=no" />
<meta name="format-detection" content="email=no" />4. When a website is added to the home screen quick launch mode, the address bar can be hidden, only for ios safari
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<span style="font-size: 14px;"></span>So the common template on the page is as follows:
##<pre class="brush:php;toolbar:false"><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta content="email=no" name="format-detection">
<title>标题</title>
<link rel="shortcut icon" href="/favicon.ico">
</head>
<body>
这里开始内容
</body>
</html></pre><span style="font-size: 14px;"></span>4. How to define font-family on the mobile terminal
body{font-family: "Helvetica Neue", Helvetica, sans-serif;}5: The code to make a call under Android or IOS is as follows:
<a href="tel:15602512356">打电话给:15602512356</a>Six: Send text messages (winphone system is invalid)
<a href="sms:10010">发短信给: 10010</a>
<p><a href="mailto:tugenhua@126.com">发电子邮件</a></p>
<p><a href="mailto:tugenhua@126.com?cc=879083421@qq.com">填写抄送地址</a></p>
<span style="font-size: 14px;">In android phone, the following code: </span>
<p><a href="mailto:tugenhua@126.com?879083421@qq.com">填写抄送地址</a></p>
<span style="font-size: 14px;">3. Fill in the blind carbon copy address, the following code: </span>
<a href="mailto:tugenhua@126.com?cc=879083421@qq.com&bcc=aa@qq.com">填上密件抄送地址</a>
<span style="font-size: 14px;"> under Android; the following code: </span>
<p><a href="mailto:tugenhua@126.com?879083421@qq.com?aa@qq.com">填上密件抄送地址</a></p>
<p><a href="mailto:tugenhua@126.com;879083421@qq.com;aa@qq.com">包含多个收件人、抄送、密件抄送人,用分号隔(;)开多个收件人的地址即可实现</a></p>
<p><a href="mailto:tugenhua@126.com?subject=【邀请函】">包含主题,可以填上主题</a></p>
<p><a href="mailto:tugenhua@126.com?body=我来测试下">包含内容,用?body=可以填上内容</a></p>
<p><a href="mailto:tugenhua@126.com?body=http://www.baidu.com">内容包含链接,含http(s)://等的文本自动转化为链接</a></p>
如果想要默认的颜色显示红色,代码如下:
input::-webkit-input-placeholder{color:red;}
如果想要用户点击变为蓝色,代码如下:
input:focus::-webkit-input-placeholder{color:blue;}
input,textarea { -webkit-appearance: none; }
a, img { -webkit-touch-callout: none; }
calc基本语法: <span style="font-size: 14px;">.class {width: calc(expression);}</span>
它可以支持加,减,乘,除; 在我们做手机端的时候非常有用的一个知识点;
优点如下:
1. 支持使用 “+”,”-“,”*” 和 “/” 四则运算。
2. 可以混合使用百分比(%),px,em,rem等作为单位可进行计算。
浏览器的兼容性有如下:
IE9+,FF4.0+,Chrome19+,Safari6+
如下测试代码: <span style="font-size: 14px;"></span>
<p class="calc">我是测试calc</p> .calc{ margin-left:50px; padding-left:2rem; width:calc(100%-50px-2rem); height:10rem; }
The above is the detailed content of Summary of knowledge about HTML5. For more information, please follow other related articles on the PHP Chinese website!