Use @media screen to achieve adaptive web page layout

It is often a headache for the layout dislocation under different resolution devices or different window sizes. You can use @media screen to achieve adaptive web page layout.
Advantages: no plug-ins and mobile themes are required, friendly to mobile devices, and can adapt to various window sizes
. Add the @media screen property to CSS, judge and output different length and width values ​​according to the browser width
reading experience

@media screen and (min-width:1200px){
	#page{ width: 1100px; }#content,.div1{width: 730px;}#secondary{width:310px}
}

@media screen and (min-width: 960px) and (max-width: 1199px) {
	#page{ width: 960px; }#content,.div1{width: 650px;}#secondary{width:250px}select{max-width:200px}
}
@media screen and (min-width: 768px) and (max-width: 959px) {
	#page{ width: 900px; }#content,.div1{width: 620px;}#secondary{width:220px}select{max-width:180px}
}
@media only screen and (min-width: 480px) and (max-width: 767px){
	#page{ width: 450px; }#content,.div1{width: 420px;position: relative; }#secondary{display:none}#access{width: 450px; }#access a {padding-right:5px}#access a img{display:none}#rss{display:none}#branding #s{display:none}
}
@media only screen and (max-width: 479px) {
	#page{ width: 300px; }#content,.div1{width: 300px;}#secondary{display:none}#access{width: 330px;} #access a {padding-right:10px;padding-left:10px}#access a img{display:none}#rss{display:none}#branding #s{display:none}#access ul ul a{width:100px}
}

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326940531&siteId=291194637