rem adaptation case:
Highly adaptable, it is now hard-coded
Adapt to different screens
There are two implementations for adapting different pages according to different devices
If it is under 320 pixel font, how big is the font
How big is the screen at 750 pixels
The ratio is 2rem
First take a standard manuscript to count as rem
How do we calculate the value of scaling rem
I have a box of 100 pixels here, 100 is the element value of the page, how to calculate 50, it is divided by the score of my screen, my screen is 750, divided into 15 parts, each part is 50, in our There is such a picture under the page, how big is it at 750 pixels
How to achieve self-adaptation when there are such pictures on the page:
How to propose a technology selection idea, and what should the proposed technology selection include:
Build the page structure
First change my Css style to this, and then import the initial file
Tell it to set it as a public style file
This technology should pay attention to the adaptation of the user's mobile phone screen. It is best to set up the website with user feedback
The final result is calculated
This sentence in html must be written at the top, this sentence must be written:
After the public style file is written, write the homepage style file
Import the public style file in the home page style file and create a new index.less file:
Import style files, import files with @import "common";
link is to introduce the file into the Css style file
The writing of the style must have a min -width, and at the same time, it is displayed in the center
Write it to death directly here, because our design draft is 750 pixels, and our 1rem is 50px, so it is written as 15rem here, and it can be written as 15rem
write me font and background color
How the top search box is shaped
When writing a box, there is width, height, and size. The width is 15rem. How to calculate the height can be converted.