HTML5 responsive layout (1)
The layout method of mobile terminal development-fluid layout
The first time you encounter the concept of fluid layout, you will think that this concept is very high-end, but after a deeper understanding, you will find that it is actually very simple. For those who have experience in HTML desktop web development, in fact, fluid layout is Changed some hard-coded layouts on the desktop to percentages to adapt to various mobile sizes.
Flow layout can also be called percentage layout in layman’s terms, which usually includes the following points:
-
Width percentage
#Positioning percentage
Replace px with em, and rem
Elastic picture The reference object for setting these percentages is adapted according to the screen size of the mobile phone, and a certain effect is achieved through size adaptation.
#Why do you need to use fluid layout? Adapt to mobile terminal?
#Fixed pixel size web pages are the easiest way to match fixed pixel size displays. But this method is not a fully compatible production method for future web pages. We need some methods to adapt to unknown devices. Fixed pixel sizes (960/980) are not future proof.
#How to use percentages to layout page? Size percentage: Modify the web page from fixed layout to percentage layout: Required Formula to remember: target element width / context element width = percentage width. #PS: The width of the context element here refers to the width of the parent element associated with it, which will directly affect the width percentage of the child element. Position percentage: is basically similar to the size percentage, that is, the original fixed margin or Positioning distance converted into percentage For example: With the left side of the page 50px and the context width 320px, that is 50/320=15.625% Reserve 5 decimal point. ##em: The function of em is generally to set the font size, set a standard font size in its parent, and control the percentage of the font through em. The value of em is not fixed; #em will inherit the font size of the parent element.
##rem: Although em can realize the percentage display of fonts and change the font size in proportion according to the screen size, once structural nesting occurs during the actual development process, the parent font will When the proportion changes, the font of the child element will change proportionally according to the change of the parent's font. If em is used to change the font, the calculation amount will be very large, which will inevitably cause a certain burden on development. A new unit rem was introduced in css3, which will only change based on HTML tags. rem stands for root em, and the root of em is html, which means the proportion changes only based on html. ##Flexible image: Image settings width:100%, or background-size:100% 100%. Picture setting threshold: max-width. can set the maximum and minimum values of the picture. Of course, fluid layout is only a way to adapt to mobile terminals, and it cannot achieve the effect of responsive web pages. Later, I will introduce to you another adaptation method called media query. Only by combining the two adaptation methods can the final responsive layout effect be achieved.

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.

HTML5hassignificantlytransformedwebdevelopmentbyintroducingsemanticelements,enhancingmultimediasupport,andimprovingperformance.1)ItmadewebsitesmoreaccessibleandSEO-friendlywithsemanticelementslike,,and.2)HTML5introducednativeandtags,eliminatingthenee

H5 improves web page accessibility and SEO effects through semantic elements and ARIA attributes. 1. Use, etc. to organize the content structure and improve SEO. 2. ARIA attributes such as aria-label enhance accessibility, and assistive technology users can use web pages smoothly.

"h5" and "HTML5" are the same in most cases, but they may have different meanings in certain specific scenarios. 1. "HTML5" is a W3C-defined standard that contains new tags and APIs. 2. "h5" is usually the abbreviation of HTML5, but in mobile development, it may refer to a framework based on HTML5. Understanding these differences helps to use these terms accurately in your project.

H5, or HTML5, is the fifth version of HTML. It provides developers with a stronger tool set, making it easier to create complex web applications. The core functions of H5 include: 1) elements that allow drawing graphics and animations on web pages; 2) semantic tags such as, etc. to make the web page structure clear and conducive to SEO optimization; 3) new APIs such as GeolocationAPI support location-based services; 4) Cross-browser compatibility needs to be ensured through compatibility testing and Polyfill library.


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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

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

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft