简体   繁体   English

带有 wordpress 页面的 div 上的响应高度

[英]Responsive height on div with wordpress page

How can I make a div which I display content in from wordpress page.php responsive to the Wordpress page height.如何制作一个 div 来显示 wordpress 页面中的内容。php 响应 Wordpress 页面高度。 Here is how I display the page on my website.这是我在我的网站上显示页面的方式。

<?php 
        while(have_posts()) {
            the_post(); ?>
    <div class="page-content">
        <h1> <?php the_title(); ?> </h1>


        <?php the_content(); ?>
    </div>

And the css: css:

.page-content {
    display: inline-block;
    width: 70%;
    height: 135vh;
    border: 1px black solid;
    margin-left: 5%;
    padding: 16px;
    background-color: white;
}

Can I make the height of the div the same as the height on the wp page?我可以使div的高度与wp页面上的高度相同吗?

To make the height of the div in your page, don't force the height and add要在页面中设置 div 的高度,请不要强制设置高度并添加

min-height : 100vh

From what I understand据我了解

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

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