移动端设置适配font-size

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/guanguan0_0/article/details/84790821

移动端设置适配font-size

根据屏幕的大小设置不同的根节点font-size,开发时即使用rem来使其达到自适应

@media screen and (min-width:287px) and (max-width:320px) {
	html {
		font-size: 10px !important
	}
}
@media screen and (min-width:321px) and (max-width:375px) {
	html {
		font-size: 11px !important
	}
}

@media screen and (min-width:376px) and (max-width:414px) {
	html {
		font-size: 12px !important
	}
}

@media screen and (min-width:415px) and (max-width:639px) {
	html {
		font-size: 15px
	}
}

@media screen and (min-width:640px) and (max-width:719px) {
	html {
		font-size: 20px
	}
}

@media screen and (min-width:720px) and (max-width:749px) {
	html {
		font-size: 22.5px
	}
}

@media screen and (min-width:750px) and (max-width:799px) {
	html {
		font-size: 23.5px
	}
}

@media screen and (min-width:800px) {
	html {
		font-size: 25px
	}
}

猜你喜欢

转载自blog.csdn.net/guanguan0_0/article/details/84790821