search
HomeWeb Front-endHTML Tutorialweb前端开发-移动端页面开发资源总结_html/css_WEB-ITnose

                                                                            web前端开发-移动端页面开发资源总结

工作了有一段时间,基本上都在搞移动端的前端开发,工作的过程中遇到过很多问题,bug的解决方案,记录下来,以便后用!!!内容并不是很全,以后每遇到一个问题都会总结在这里,分享给大家!

一、meta标签相关知识

1、移动端页面设置视口宽度等于设备宽度,并禁止缩放。

2、移动端页面设置视口宽度等于定宽(如640px),并禁止缩放,常用于微信浏览器页面。

3、禁止将页面中的数字识别为电话号码

4、忽略Android平台中对邮箱地址的识别

5、当网站添加到主屏幕快速启动方式,可隐藏地址栏,仅针对iossafari

6、将网站添加到主屏幕快速启动方式,仅针对iossafari顶端状态条的样式

viewport模板

title

 

    content...

 

二、CSS样式技巧

1、禁止iosandroid用户选中文字

.css{-webkit-user-select:none}

2、禁止ios长按时触发系统的菜单,禁止ios&android长按时下载图片

.css{-webkit-touch-callout: none}

3webkit去除表单元素的默认样式

.css{-webkit-appearance:none;}

4、修改webkit表单输入框placeholder的样式

input::-webkit-input-placeholder{color:#AAAAAA;}

input:focus::-webkit-input-placeholder{color:#EEEEEE;}

5、去除android a/button/input标签被点击时产生的边框 & 去除ios a标签被点击时产生的半透明灰色背景

a,button,input{-webkit-tap-highlight-color:rgba(255,0,0,0);}

6ios使用-webkit-text-size-adjust禁止调整字体大小

body{-webkit-text-size-adjust: 100%!important;}

7android 上去掉语音输入按钮

input::-webkit-input-speech-button {display: none}

8、移动端定义字体,移动端没有微软雅黑字体

/* 移动端定义字体的代码 */

body{font-family:Helvetica;}

三、其他技巧

1、手机拍照和上传图片

2、取消inputios下,输入的时候英文首字母的默认大写

3、打电话和发短信

打电话给:0755-10086

发短信给: 10086

四、CSS reset

/* hcysun  */

@charset "utf-8";

/* reset */

html{

    -webkit-text-size-adjust:none;

    -webkit-user-select:none;

    -webkit-touch-callout: none

    font-family: Helvetica;

}

body{font-size:12px;}

body,h1,h2,h3,h4,h5,h6,p,dl,dd,ul,ol,pre,form,input,textarea,th,td,select{margin:0; padding:0; font-weight: normal;text-indent: 0;}

a,button,input,textarea,select{ background: none; -webkit-tap-highlight-color:rgba(255,0,0,0); outline:none; -webkit-appearance:none;}

em{font-style:normal}

li{list-style:none}

a{text-decoration:none;}

img{border:none; vertical-align:top;}

table{border-collapse:collapse;}

textarea{ resize:none; overflow:auto;}

/* end reset */

五、常用公用CSS style

/* public */

/* 清除浮动 */

.clear { zoom:1; }

.clear:after { content:''; display:block; clear:both; }

/* 定义盒模型为怪异和模型(宽高不受边框影响) */

.boxSiz{

    -webkit-box-sizing: border-box;

    -moz-box-sizing: border-box;

    -ms-box-sizing: border-box;

    -o-box-sizing: border-box;

    box-sizing: border-box;

}

/* 强制换行 */

.toWrap{

    word-break: break-all;       /* 只对英文起作用,以字母作为换行依据。 */

    word-wrap: break-word;      /* 只对英文起作用,以单词作为换行依据。*/

    white-space: pre-wrap;     /* 只对中文起作用,强制换行。*/

}

/* 禁止换行 */

.noWrap{

    white-space:nowrap;

}

/* 禁止换行,超出省略号 */

.noWrapEllipsis{

     white-space:nowrap; overflow:hidden; text-overflow:ellipsis;

}

/* 文字两端对齐 */

.text-justify{

    text-align:justify;

    text-justify:inter-ideograph;

}

/* 定义盒模型为 flex布局兼容写法并让内容水平垂直居中 */

.flex-center{

    display: -webkit-box;

    display: -moz-box;

    display: -ms-flexbox;

    display: -o-box;

    display: box;

    -webkit-box-pack: center;

    -moz-box-pack: center;

    -ms-flex-pack: center;

    -o-box-pack: center;

    box-pack: center;

    -webkit-box-align: center;

    -moz-box-align: center;

    -ms-flex-align: center;

    -o-box-align: center;

    box-align: center;

}

/* public end */

六、flex布局

1、定义弹性盒模型兼容写法

/*

    box

    inline-box

*/

display: -webkit-box;

display: -moz-box;

display: -ms-flexbox;

display: -o-box;

display: box;

2box-orient 定义盒模型内伸缩项目的布局方向

/**

 * vertical column  垂直

 * horizontal row   水平 默认值

 */

-webkit-box-orient: horizontal;

-moz-box-orient: horizontal;

-ms-flex-direction: row;

-o-box-orient: horizontal;

box-orient: horizontal;

3box-direction 定义盒模型内伸缩项目的正序(normal默认值)、倒叙(reverse)

/* Firefox */

display:-moz-box;

-moz-box-direction:reverse;

/* Safari、Opera 以及 Chrome */

display:-webkit-box;

-webkit-box-direction:reverse;

4box-pack 对盒子水平富裕空间的管理

/*

    start

    end

    center

    justify

*/

-webkit-box-pack: center;

-moz-box-pack: center;

-ms-flex-pack: center;

-o-box-pack: center;

box-pack: center;

5box-pack 对盒子垂直方向富裕空间的管理

/*

    start

    end

    center

*/

/* box-align */

-webkit-box-align: center;

-moz-box-align: center;

-ms-flex-align: center;

-o-box-align: center;

box-align: center;

6、定义伸缩项目的具体位置

/*-moz-box-ordinal-group:1;*/ /* Firefox */

/*-webkit-box-ordinal-group:1;*/ /* Safari 和 Chrome */

.box div:nth-of-type(1){-webkit-box-ordinal-group:1;}

.box div:nth-of-type(2){-webkit-box-ordinal-group:2;}

.box div:nth-of-type(3){-webkit-box-ordinal-group:3;}

.box div:nth-of-type(4){-webkit-box-ordinal-group:4;}

.box div:nth-of-type(5){-webkit-box-ordinal-group:5;}

7、定义伸缩项目占空间的份数

-moz-box-flex:2.0; /* Firefox */

-webkit-box-flex:2.0; /* Safari 和 Chrome */

 

.box div:nth-of-type(1){-webkit-box-flex:1;}

.box div:nth-of-type(2){-webkit-box-flex:2;}

.box div:nth-of-type(3){-webkit-box-flex:3;}

.box div:nth-of-type(4){-webkit-box-flex:4;}

.box div:nth-of-type(5){-webkit-box-flex:5;}

 

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
HTML as a Markup Language: Its Function and PurposeHTML as a Markup Language: Its Function and PurposeApr 22, 2025 am 12:02 AM

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML: Building the Structure of Web PagesHTML: Building the Structure of Web PagesApr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

From Text to Websites: The Power of HTMLFrom Text to Websites: The Power of HTMLApr 13, 2025 am 12:07 AM

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.