Home > Backend Development > PHP Problem > 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
Release: 2023-02-27 12:08:02
Original
2588 people have browsed it

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"/>
Copy after login

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%;
}
Copy after login

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

1, < meta name="format-detection"/>

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"/>
Copy after login

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"/>
Copy after login

2.

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

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.


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” />
Copy after login

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!

Related labels:
source:php.cn
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