【问题标题】:When I decrease the height of browser the width of box should decrease automatically当我降低浏览器的高度时,框的宽度应该会自动减小
【发布时间】:2018-03-07 22:47:35
【问题描述】:

当我减小浏览器的高度时,框的宽度应该会自动减小。

Example here

这种需求的 jQuery 或 Javascript 代码是什么?有onresize="myFunction()吗?

【问题讨论】:

    标签: browser height width


    【解决方案1】:

    您可以按百分比设置框的高度。因此,如果您降低浏览器的高度,它会自动降低。

    只需在您的 css 中设置参数。

    height="100%"

    width="auto"

    【讨论】:

    • 我认为用 css 是不可能的。检查你会理解的图像
    • 或者只是设置margin和padding的百分比
    • 这里有一个小教程如何做到这一点:w3schools.com/html/html_responsive.asp
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-10-05
    • 2013-07-21
    • 2013-04-22
    • 2020-06-23
    • 1970-01-01
    • 2013-05-23
    • 2022-07-07
    相关资源
    最近更新 更多