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

How to install Jenkins on CentOS 8

To install Jenkins on CentOS 8, you need to use t...

IE9beta version browser supports HTML5/CSS3

Some people say that IE9 is Microsoft's secon...

One line of code solves various IE compatibility issues (IE6-IE10)

x-ua-compatible is used to specify the model for ...

WeChat applet picker multi-column selector (mode = multiSelector)

Table of contents 1. Effect diagram (multiple col...

Implementing circular scrolling list function based on Vue

Note: You need to give the parent container a hei...

Notes on the MySQL database backup process

Today I looked at some things related to data bac...

Vue el-date-picker dynamic limit time range case detailed explanation

There are two situations 1. Start time and end ti...

Q&A: Differences between XML and HTML

Q: I don’t know what is the difference between xml...

How to deploy services in Windows Server 2016 (Graphic Tutorial)

introduction Sometimes, if there are a large numb...

Vue image cropping component example code

Example: tip: This component is based on vue-crop...

How to draw a vertical line between two div tags in HTML

Recently, when I was drawing an interface, I enco...

HTML embedded in WMP compatible with Chrome and IE detailed introduction

In fact, there are many corresponding writing met...

A brief discussion on the characteristics of CSS float

This article introduces the characteristics of CS...