简体   繁体   中英

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. 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:

.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?

To make the height of the div in your page, don't force the height and add

min-height : 100vh

From what I understand

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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