Home > Article > Web Front-end > Summary of basic knowledge on mobile terminals
1. Unit (px, em, rem)
1.px: The smallest point that the screen device can physically display, points on different devices The length, width, and ratio are not necessarily the same;
2. em/rem: Similar points: both are a relative size value; different points: em is relative to the parent element, and rem is relative to html (the default value depends on the browser Depends on the browser, Chrome's default is 16px);
rem units are very popular in mobile front-end development. The rem unit does have a lot of benefits. It is relative to the root node, allowing us to unify the entire website unit. It can also make our fonts better adapt to the size of the website. However, if you have used it, you will know that it will cause a problem: when you use the Chrome browser to open the website you made, sometimes a large font will appear. Condition. But just refresh the page.
The reason why this happens is because for the convenience of calculation, we changed the original default 1rem=16px to 1rem=10px; therefore, we usually make the following settings in html:
html{ font-size:62.5%;/*10÷16×100=62.5% 1rem=10px*/ }
However, the Chrome browser sometimes ignores the html settings, so when initializing the page, the above font appears to be too large. If you study carefully, you will find that "elements" with too large fonts usually do not have font-size set. The font-size of the element is inherited from the root directory. Therefore, the solution is: in the parent of the text you want to display or other Set the font-size yourself; Standard, case-insensitive, HTML code:
nbsp;html><!-- 使用HTML5 DOCTYPE 不区分大小写 -->2.lang: This attribute is placed in the tag to set the language type of the document (English: en; Chinese :zh, etc.), HTML code:
...
<meta>
Telephone: Convert numbers to dial-up links (yes/no) - no: prohibit the conversion of numbers For dial-up links, yes: enable the conversion of numbers into dial-up links;
adress: Click on the address to jump to the map - no: prohibit jumping to the map, yes: enable the function of clicking on the address to jump to the map;
<meta>
5.viewport (For mobile devices) →content parameters:
Width: viewport width; height: viewport height (usually not set); initial-scale: initial scaling ratio; maximum-scale: maximum scaling ratio; minimum-scale :Minimum scaling ratio; user-scalable: whether to allow scaling (yes/no)
<meta>
6.SEO optimization:
Title (page title):
Description(page description):< ;meta name="description" content="your description"/>
Author (webpage author):
Robots (webpage search engine indexing method): robotterms is a set of values separated by commas (,), usually the value:
none: The search engine will ignore this web page, which is equivalent to noindex, nofollow;
noindex: The search engine will not index this page; nofollow: The search engine will not continue to search other pages through the link index of this page;
all: The search engine will index this page and continue to index this page through Link index, equivalent to index, follow;
Index: Search engines index this web page; follow: Search engines continue to search other web pages through the link index of this web page;
<meta>
1.H5页面窗口自动调整到设备宽度,禁止用户缩放
<meta>
2. Ignore the recognition of the numbers on the page as phone numbers (easy to occur on ios devices)
<meta>
<meta>
body{ -webkit-overflow-scrolling:touch; overflow-scrolling:touch; }
body{ -webkit-user-select:none; -moz-user-select:none; -khtml-user-select:none; user-select:none; }
The above is the detailed content of Summary of basic knowledge on mobile terminals. For more information, please follow other related articles on the PHP Chinese website!