I am having a problem placing the contents of a list item below the bottom line.
take a look at this:
<ul> <li class="box"> <div class="close" ></div> <div class="head"> Header </div> <p class="area"> This is Paragraph </p> </li> <li class="box"> <div class="close" ></div> <div class="head"> Header </div> <p class="area"> This is Paragraph </p> </li> </ul>
And the jquery part:
$( document ).on( "click", "ul li .head", function() { $(this).parent('li').toggleClass( 'minimize' ); $(this).parent('li').children('p').toggle(); });
And finish the CSS
ul { position: static; bottom: -4px; width: 1150px; min-height: 250px; overflow: hidden; } ul li { position: relative; border: 1px solid lightgray; width: 260px; background-color: #f2f2f2; display: inline-block; margin: 0 2px; } ul li .head { font-weight: bold; padding: 5px; background-color: #6D84B4; color: white; border: 1px solid #6D84B4; text-align: right; } p.area { padding: 8px; height: 200px; } .minimize { vertical-align: bottom;}
Here is the jsFiddle link:
jsFiddle reference
Description
When I click on only one heading, the paragraph and heading are hidden. (OK) But when I click on another heading, both of them jump up again.
any help on this.
Thanks.
UNITED AND SOLVED:
Ok, I was hoping someone could help me solve this problem with css.
But I did the trick using jQuery. it works. but I donβt know if itβs good or not.
Here is the code:
Updated Code
source share