我需要让我的网站适合屏幕
我已将网站创建为固定布局,宽度为1600px, 但是分辨率较低的网页看起来太大. 我应该怎么做才能使它在每个分辨率下看起来都很好?
I have created my website as a fixed layout, with a width of 1600px, but the webpage on a smaller resolution looks too big. What am I supposed to do to make it looks good in every resolution?
感谢帮助
使用相对度量,例如width: 100%
.您可以使用min-width
和max-width
来进一步限制它.
Use relative measures, like width: 100%
. You can constrain this even more by using min-width
and max-width
.
除此之外,您可以使用 CSS media queries
制作仅在满足某些条件时才适用的样式,例如最小或最大宽度.如果您使用它,则可以更改网站的整体外观,例如在较小的设备上隐藏部分内容,或者在较小的设备上将文本显示从2列更改为1列.
Apart from that, you can use CSS media queries
to make styles that only apply if certain conditions are met, like a minimum or maximum width. If you use that, you can change the whole look and feel of your website, for instance by hiding parts on smaller devices or change from a 2 column to a 1 column text presentation on smaller devices.