【问题标题】:change div height as the content grows automatically随着内容自动增长,更改 div 高度
【发布时间】:2016-02-13 01:17:31
【问题描述】:

我正在自定义一个 wordpress 主题,当您单击 Book a Valuation 菜单项 screenshot 时,我会在弹出窗口中显示联系表单,您可以看到内容溢出(我不想添加滚动条)。我已经遵循here 给出的所有答案,但没有任何帮助我解决问题。网站link

【问题讨论】:

    标签: css wordpress height


    【解决方案1】:

    在您的 CSS 中使用 height: auto;

    【讨论】:

    • 使用自动高度使背景透明,
    • 我仍然看到!important。这是有原因的吗?可能是因为您还设置了height inline,但仍然在 px 中。
    • 哦,刚刚删除了它,但您现在可以看到它的高度增加了太多。 prntscr.com/91pjl7
    • 正如您在浏览器开发者工具中看到的那样,height 被设置成一行,这导致它的高度为 400px。
    • 删除了但现在背景再次透明
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-15
    • 2016-02-29
    • 1970-01-01
    • 1970-01-01
    • 2013-01-18
    • 2020-08-31
    相关资源
    最近更新 更多