简体   繁体   中英

website screen resolution auto resize

I have a website, its uses the 960 grid system, everything is fine.

Except the header, the header is too tall!

Is it possible to reduce the entire website size when the user's screen is less than or equal to 1024x768 ?

(same way you can press CTRL+ and CTRL- in IE?)

IE确实支持非标准缩放样式 ,如果检测到窗口大小过小,则可以将其应用于<body>

Technically this is possible, but I would advise against using such non-conventional approaches. I would just use a short header that will look good both in <= 768 and > 768.

After the document is loaded, you could check (using JavaScript) the client height of the body and apply a style to your <body> element (or just the header) to set the font size to a certain percentage. All your other dimensions would have to defined in em or percentage units so that the base size at the main container propagates to child elements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM