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

js regular expression lookahead and lookbehind and non-capturing grouping

Table of contents Combining lookahead and lookbeh...

Node uses async_hooks module for request tracking

The async_hooks module is an experimental API off...

Enabling or disabling GTID mode in MySQL online

Table of contents Basic Overview Enable GTID onli...

How to add double quotes in HTML title

<a href="https://www.jb51.net/" titl...

Cross-database association query method in MySQL

Business scenario: querying tables in different d...

HTML table tag tutorial (46): table footer tag

The <tfoot> tag is used to define the style...

Vue custom components use event modifiers to step on the pit record

Preface Today, when I was using a self-written co...

Using JS to implement a simple calculator

Use JS to complete a simple calculator for your r...

How to extend Vue Router links in Vue 3

Preface The <router-link> tag is a great to...

MySQL encoding utf8 and utf8mb4 utf8mb4_unicode_ci and utf8mb4_general_ci

Reference: MySQL character set summary utf8mb4 ha...

HTML n ways to achieve alternate color code sample code

This article mainly introduces the sample code of...