繁体   English   中英

如何在更改窗口大小时调整网页上的文本?

[英]How to adjust text on the web page page on changing window size?

我正在使用移动jquery进行设计。 我想调整网页/屏幕上的文字,以便在所有移动设备上自动调整文字。 我该如何接受? 任何想法?

在body和html元素上设置宽度和高度,以使页面最大。 我知道,您也必须设置html元素也很奇怪,但这就是生活。

html, body {
    width:100%;
    height:100%;
}

在您的标记中定义您的部分。

<section>...</section>
<section>...</section>
<section>...</section>

并调整页面的大小以适合加载和页面调整大小。 就像是:

function draw() {
    var width = $(document).width();
    var height = $(document).height();

    $("section").width(width).height(height);
}

$(document).resize(draw);
$(draw);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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