当前位置:网站首页>Flex/fixed upper, middle and lower (mobile end)
Flex/fixed upper, middle and lower (mobile end)
2022-06-12 05:35:00 【Xibing_ G】
Scheme 1 : Don't use fixed
html{
height:100vh;
/* If you don't give here 100%, That would be automatic , Then the bottom column goes to the bottom ( Out of viewport ) */
font-size:26.667vw;
/*
100vw=375px 1px=0.26667vw
For the convenience of calculation, set font-size by 100px, That is to say 26.667vw
In order to follow the screen changes , So it's used here vw The benchmark , Not fixed px
*/
}
body{
width:100%;
height:100%;
/* If you don't give here 100%( Father height 100%), That would be automatic , Then the bottom column goes to the bottom ( Out of viewport ) */
display: flex;
font-size: 0.16rem;
flex-direction: column;
}
header{
height:.67rem;
/* Measured 67px Namely 67/(html Of font-size)=67/100=0.67rem */
}
main{
flex:1;
overflow:auto;
}
footer{
height:.5rem;
}Option two : Use fixed
html{
height:100vh;
/* If you don't give here 100%, That would be automatic , Then the bottom column goes to the bottom ( Out of viewport ) */
font-size:26.667vw;
/*
100vw=375px 1px=0.26667vw
For the convenience of calculation, set font-size by 100px, That is to say 26.667vw
In order to follow the screen changes , So it's used here vw The benchmark , Not fixed px
*/
}
body{
width:100%;
height:100%;
/* If you don't give here 100%( Father height 100%), That would be automatic , Then the bottom column goes to the bottom ( Out of viewport ) */
font-size: 0.16rem;
}
header{
height:.67rem;
/* Measured 67px Namely 67/(html Of font-size)=67/100=0.67rem */
positon:fixed;
left:0;
bottom:0;
}
main{
overflow:auto;
padding-top:0.67rem;
/* because header Fixed , Off stream , So we can only show it by squeezing down here main Original quilt of header Part of the cover up */
padding-bottom:.5rem;
/* Corresponding footer Height , Avoid being obscured by the bottom , Squeeze up */
}
footer{
height:.5rem;
positon:fixed;
left:0;
bottom:0;
}边栏推荐
- Abstract methods and interfaces
- Platform of ASoC framework driven by alsa
- 16. Somme des trois plus proches
- How long is the company's registered capital subscribed
- DMA RDMA technology details
- Introduction to Internet Protocol
- Qs100 at command mqtt access thingsboard
- Necessary for Test Engineer -- package capturing tool fiddler
- Detailed usage of vim editor
- @Configurationproperties value cannot be injected
猜你喜欢

Legal liabilities to be borne by the person in charge of the branch

Introduction to Internet Protocol

Word frequency statistics using Jieba database

ESP8266 Arduino OLED

Detailed explanation of data envelopment analysis (DEA) (taking the 8th Ningxia provincial competition as an example)

How Wireshark decrypts WiFi data packets

Vivado HLS introductory notes

国企为什么要上市

Performance test - GTI application service performance monitoring platform

16. sum of the nearest three numbers
随机推荐
虚函数与纯虚函数的关系
WiFi band resources
Kubernetes certificate online update
Test work summary - performance test indicators
Go 接口实现原理【高阶篇】
yolov5
Serial port oscilloscope_ port_ Setup of plotter secondary development environment (including QT setup)
Thingsboard view telemetry data through database
Object class not ended
20. string representing numeric value
@Configurationproperties value cannot be injected
DMA RDMA technology details
Wireshark filter rule
Platform of ASoC framework driven by alsa
The combined application of TOPSIS and fuzzy borde (taking the second Dawan District cup and the national championship as examples, it may cause misunderstanding, and the Dawan District cup will be up
Why should state-owned enterprises go public
[getting to the bottom] five minutes to understand the combination evaluation model - fuzzy borde (taking the C question of the 2021 college students' numerical simulation national competition as an e
Multi thread learning III. classification of threads
Laravel8 when search
A solution for PHP to implement image login verification code