Tips on making web pages for mobile phones

Tips on making web pages for mobile phones
Considering that many people now use smartphones, the writing method of mobile web pages is basically the same as that of ordinary web pages.

The width of the mobile page is best controlled within 240px, because this allows a series of operations to be performed without moving the screen. Our company's project used a background image with a size of 240*420. This actually has a disadvantage. I have to control the height of each page within 420, otherwise it will look ugly if it exceeds the limit.

Neither ordinary mobile phones nor smart phones seem to support js. Functions like <a href="javascript:history.back()"> and "alert()" are not supported. In addition, mobile phones do not support the style of "<input type="button">" very well. The same code has a certain width difference between the browser and the mobile phone, given the width. So my suggestion is to avoid using buttons if possible. You can use text hyperlinks instead, or you can consider using small icons.

It is best to use table for list pages instead of ul li, or p+space. On the one hand, it is for typesetting, and on the other hand, if the elements in a column are too long, you can use "table tr td{word-break:break-all;}". The other two solutions can only truncate the string. Of course, from my point of view, truncate the string may be a good choice, because the height of my pages is fixed.

There is still a certain necessity for large pictures. For example, navigation maps can give people a dazzling feeling, but the pictures cannot be too large and must be controlled within 10K. Our company's navigation map uses a page similar to Lenovo mobile phones, as follows:

The details of mobile web pages may be far less than those of ordinary web pages. At least it only needs to be passed on the mobile page, without the need for IE6 7 8 or other browsers. However, it still requires some thought to make it look good.

<<:  Detailed explanation of the principle of Vue monitoring data

>>:  Solve mysql: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES)

Recommend

Define your own ajax function using JavaScript

Since the network requests initiated by native js...

How to allow external network access to mysql and modify mysql account password

The root account of mysql, I usually use localhos...

JavaScript web form function communication full of practical information

1. Introduction Earlier we talked about the front...

How to restore a database and a table from a MySQL full database backup

In the official MySQL dump tool, how can I restor...

Introduction to HTML DOM_PowerNode Java Academy

What is DOM? With JavaScript, you can reconstruct...

Nginx Service Quick Start Tutorial

Table of contents 1. Introduction to Nginx 1. Wha...

The difference between MySQL database host 127.0.0.1 and localhost

Many of my friends may encounter a problem and do...

New ways to play with CSS fonts: implementation of colored fonts

What if you designers want to use the font below ...

Detailed steps for installing JDK and Tomcat on Linux cloud server (recommended)

Download and install JDK Step 1: First download t...

Talking about ContentType(s) from image/x-png

This also caused the inability to upload png files...

Analysis of basic usage of ul and li

Navigation, small amount of data table, centered &...

In-depth analysis of MySQL indexes

Preface We know that index selection is the work ...

Understanding what Node.js is is so easy

Table of contents Official introduction to Node.j...

Zookeeper unauthorized access test problem

Table of contents Preface Detect Zookeeper servic...