Home  >  Article  >  Backend Development  >  The php web page is not full on the left and right sides on the mobile phone

The php web page is not full on the left and right sides on the mobile phone

angryTom
angryTomOriginal
2019-10-19 11:14:042522browse

The php web page is not full on the left and right sides on the mobile phone

php webpage is not full on the mobile phone

When the webpage is displayed on the mobile phone, a meta## needs to be set #Metadata (Metadata is also called intermediary data and relay data, which is the data that describes the data). In this way, the size of the web page will adapt to our mobile screen. Add in the head tag of the html:

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/>

In order to make the web page fill the screen width on the mobile phone, we can set# The

css style of ##body is

body{
    padding: 0;
    margin: 0;
    width: 100%;
}

. Attached is the meta tag and other commonly used attribute usage analysis:

1, 65871c9809750e13096e696531afc0ad

When browsing on a mobile phone, this tag is used to specify whether to display the mobile phone number in the web page content as a dialing hyperlink.

The default value on iPhone is:


<meta name="format-detection" content="telephone=yes"/>

If you don’t want the phone to automatically display the phone number in the web page as a dialing hyperlink, you can write like this:

<meta name="format-detection" content="telephone=no"/>

2.4fcd90a205f0c78421c6eb4b13595b30

<meta name=”apple-mobile-web-app-capable” content=”yes” />

The function of apple-mobile-web-app-capable is to delete the default Apple toolbar and menu bar. content has two values ​​"yes" and "no". When we need to display the toolbar and menu bar, there is no need to add this line of meta. The default is to display it.

3.c71bf00e6792366514d14ff86672388a


The function is to control the status bar display style:

<meta name=”apple-mobile-web-app-status-bar-style” content=”default” />
<meta name=”apple-mobile-web-app-status-bar-style” content=”black” />
<meta name=”apple-mobile-web-app-status-bar-style” content=”black-translucent” />

default:default; black: pure black; black-translucent: translucent gray


For more PHP related knowledge, please visit

PHP Chinese website

!

The above is the detailed content of The php web page is not full on the left and right sides on the mobile phone. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:index.php what isNext article:index.php what is