Viewing 11 replies - 1 through 11 (of 11 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Thread Starter Prateek

    (@kaltime)

    sorry

    creating a new template for my website

    and having issue with minimum and maximum height function

    here is the code

    #main{
    width:100%;
    min-height:400px;
    max-height:2000px;
    margin:auto;
    margin-top:25px;
    margin-bottom:50px;
    }
    
    single.php code
    
    <div id="main">
      <div id="main2">
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
        <h1> <a>"> <?php the_title(); ?></a></h1>
        <h4>Posted on <?php the_time('F jS, Y') ?></h4>
    	<h4> About Author -
    	<?php
    	the_author_description();
    	?>
    	</h4>
    	<p></p>
        <p><?php the_content(); ?></p>
    <?php get_header(); ?>
    	</BR></BR>
    	<h6>Posted By <?php echo get_the_author() ?> | <?php echo comments_number('No comment', '1 comment', '% comments'); ?> 	</h6>
        </BR>
    	<?php comments_template(); ?>
    	</BR>
    	<hr>
        <?php endwhile; else: ?>
        <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
        <?php endif; ?>
      </div>
    
      <?php get_sidebar(); ?>
    
      </div>

    the theme is at https://edenhost.me

    It’s working: Your #main div is exactly 400px high. So I wonder if you were trying to target some other piece of content, and had the wrong name? What are you actually trying to make 400px?

    Thread Starter Prateek

    (@kaltime)

    min-height just work fine

    its max which is making me go mad

    https://edenhost.me/?p=1

    Do you mean the way the footer is overlapping the content? That’s nothing to do with your min/max height. It’s because you have .footer {position: absolute} in there.

    Thread Starter Prateek

    (@kaltime)

    can you help me fix it please?

    check it after i remove that property

    What are you trying to achieve on the page exactly?

    Thread Starter Prateek

    (@kaltime)

    https://edenhost.me/?p=1

    if you go here you will check after 400px footer background come which it should not come

    i am trying to convert a html / css base design to wordpress theme

    Ah ok,

    Change –

    .footer {
        background: url("images/footer_bg.gif") repeat scroll 0 0 transparent;
        color: #6C727B;
        font-size: 13px;
        height: 320px;
        margin: auto;
        width: 100% !important;
    }

    Too

    .footer {
        background: url("images/footer_bg.gif") repeat scroll 0 0 transparent;
        clear: both;
        color: #6C727B;
        font-size: 13px;
        height: 320px;
        margin: auto;
        width: 100% !important;
    }

    I just added clear: both; so it takes into account the min-height/max-height css properties

    Hope this helps
    J

    Thread Starter Prateek

    (@kaltime)

    Thanks it work great Thank you both of you for great and quick help

    No problemo, glad it helped.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Min-Max height css not working with wordpress’ is closed to new replies.