移动端HTML5如何开发?跟PC端有什么区别?
回复内容:
谢邀。
这问题很大,我就说个方向,有很多资料你可以自己去查。
考虑如下问题:
1. 移动端不需要 300ms 的单击确认,所以不要监听 click 事件
2. 移动端网络一般较慢,如何减小页面体积及请求数,利用好缓存?
3. 移动端需要点击的元素及其间隔不能太小,考虑手指的面积?
4. 横屏和竖屏下的表现?
5. 不同浏览器间的兼容性(太多了,如 position:fixed)?
6. Retina 屏图片会不会模糊?
7. 输入状态键盘会不会挡住输入内容?
8. 在浏览器上点击后退的行为?
9. 某些浏览器(如 Safari)的隐私模式下 cookie 和 localStorage 的替代方案?
……
请务必了解媒体查询
触摸友好
楼上Vkki说的对,但对于一个还没入门的人来说太深了
—————
在我看先选一个合适的框架很重要,能让人快速上手,bootstrap可以但就我的经验看某些情况下的性能表现像吔了屎一样,有些情况下跟jquery的插件混用还tm不兼容
个人推荐mui,别看成miui
跟hbuilder一家公司出的,js和css都比较完善
前几个月给一家网站做app,跨平台表现不错,很适合移动端h5开发
缺点是性能性能性能,两个webview叠上去就有点卡了,持续关注中
我还很业余……写一些常见的吧:
1 采取更小的js库。比如说jQuery1.x -> jQuery2.x/zepto
2 记得用meta-viewport标签调节视口
3 触摸事件的处理。推荐一个库,hammer
4 小心安卓机……有些时候他们会出一些类似于“一个事件只能绑定一个回调”之类的奇怪bug……
5 尽情使用websocket吧,主流机型好像是都支持的。
6 调试很麻烦,详见这个:怎么在移动端调试web前端? - 计算机网络
7 position:fixed不要随便用
8 flexbox很棒,你不一定非得用Bootstrap之类的库
9 做小游戏为什么不优先考虑canvas呢
没有什么本质区别,大概有几点:
屏幕尺寸小且规格繁多,需要提高视口利用率,一般不采用固定布局,而采用流式或响应式布局。
触摸、设备运动等事件的应用场合大大增多。
浏览器一般较为先进,可以使用更多先进技术。
考虑到设备性能、网络流量问题,需要更加严格控制代码质量和页面加载时间。
相关文章:

HTML5 code consists of tags, elements and attributes: 1. The tag defines the content type and is surrounded by angle brackets, such as. 2. Elements are composed of start tags, contents and end tags, such as contents. 3. Attributes define key-value pairs in the start tag, enhance functions, such as. These are the basic units for building web structure.

HTML5 is a key technology for building modern web pages, providing many new elements and features. 1. HTML5 introduces semantic elements such as, , etc., which enhances web page structure and SEO. 2. Support multimedia elements and embed media without plug-ins. 3. Forms enhance new input types and verification properties, simplifying the verification process. 4. Offer offline and local storage functions to improve web page performance and user experience.

Best practices for H5 code include: 1. Use correct DOCTYPE declarations and character encoding; 2. Use semantic tags; 3. Reduce HTTP requests; 4. Use asynchronous loading; 5. Optimize images. These practices can improve the efficiency, maintainability and user experience of web pages.

Web standards and technologies have evolved from HTML4, CSS2 and simple JavaScript to date and have undergone significant developments. 1) HTML5 introduces APIs such as Canvas and WebStorage, which enhances the complexity and interactivity of web applications. 2) CSS3 adds animation and transition functions to make the page more effective. 3) JavaScript improves development efficiency and code readability through modern syntax of Node.js and ES6, such as arrow functions and classes. These changes have promoted the development of performance optimization and best practices of web applications.

H5 is not just the abbreviation of HTML5, it represents a wider modern web development technology ecosystem: 1. H5 includes HTML5, CSS3, JavaScript and related APIs and technologies; 2. It provides a richer, interactive and smooth user experience, and can run seamlessly on multiple devices; 3. Using the H5 technology stack, you can create responsive web pages and complex interactive functions.

H5 and HTML5 refer to the same thing, namely HTML5. HTML5 is the fifth version of HTML, bringing new features such as semantic tags, multimedia support, canvas and graphics, offline storage and local storage, improving the expressiveness and interactivity of web pages.

H5referstoHTML5,apivotaltechnologyinwebdevelopment.1)HTML5introducesnewelementsandAPIsforrich,dynamicwebapplications.2)Itsupportsmultimediawithoutplugins,enhancinguserexperienceacrossdevices.3)SemanticelementsimprovecontentstructureandSEO.4)H5'srespo

The tools and frameworks that need to be mastered in H5 development include Vue.js, React and Webpack. 1.Vue.js is suitable for building user interfaces and supports component development. 2.React optimizes page rendering through virtual DOM, suitable for complex applications. 3.Webpack is used for module packaging and optimize resource loading.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

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.

Notepad++7.3.1
Easy-to-use and free code editor

WebStorm Mac version
Useful JavaScript development tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)