Note that there are some explanatory texts on larger screens.

plurals
  1. POshow/hide with CSS
    primarykey
    data
    text
    <p>Hello<br> I'm making a mailbox for my website and I want it to show/hide with CSS3 I know there are few tutorial etc on how to do it, but I tried to do it a bit differently. I'm getting a good result, however there is one issue. When I hover on an item the item<code>:hover</code> height are not changing together with the text: </p> <p><strong>styles.css:</strong> </p> <pre><code>.mailbox_item { width: 440px; height: 20px; margin: 0 auto; border-bottom: 1px solid #ccc; overflow: hidden; } .mailbox_item:hover { min-height: 100px; overflow: visible; display: block; -webkit-transition: all 0s ease-in-out; -moz-transition: all 0s ease-in-out; -o-transition: all 0s ease-in-out; -ms-transition: all 0s ease-in-out; transition: all 0s ease-in-out; } .mailbox_item_top { min-height: 20px; line-height: 13px; } .mailbox_item_body { min-height: 20px; } </code></pre> <p><strong>item.php</strong> </p> <pre><code>&lt;div class="mailbox_item"&gt; &lt;div class="mailbox_item_top"&gt; &lt;h2 class="titleannouncement"&gt;Test Announcement&lt;/h2&gt; &lt;span class="mail_author"&gt;0&lt;/span&gt; &lt;/div&gt; &lt;div class="mailbox_item_body"&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam dapibus lacinia dui at mattis. Donec vitae tellus congue leo egestas tincidunt a eget lorem. Fusce et varius velit. In sollicitudin porta arcu, vel convallis mauris varius ut. Aenean id risus a ante mattis bibendum. Sed mollis ipsum ac metus fringilla eget imperdiet urna laoreet. Quisque tincidunt, purus eu vulputate pulvinar, metus arcu malesuada ante, vitae vehicula ipsum lectus ac libero. Cras in ligula at urna tincidunt tempor. Nam sodales lectus a sem sodales congue. Suspendisse ut ultricies nunc. Aenean blandit tempor ipsum lacinia tincidunt. Mauris ut ipsum non dolor luctus volutpat. Cras quis enim at lacus placerat dictum ut et elit. Vestibulum porta varius dui, rutrum gravida orci semper sit amet. Nam ornare iaculis velit, sit amet euismod felis pulvinar et. Nam sed ipsum eget elit adipiscing tristique.&lt;/p&gt; &lt;/div&gt; &lt;div class="newsdate"&gt; &lt;span class="newsdatetext"&gt;2011-04-30 06:54:05&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>and here is what I'm getting:</p> <p><a href="http://filmuz.com/test.PNG" rel="nofollow">Normal state</a> - this is as intended</p> <p>on :hover - the <code>min-height</code> value in mailbox_item:hover stays the same and doesn't get higher when the text gets bigger</p> <p><a href="http://filmuz.com/test1.PNG" rel="nofollow">on Hover</a></p> <p>I know that I can use <code>overflow:hidden;</code> so the text wont overlap the other window but I wanted to show that there is more text. How can I force the <code>min-height</code> value to change if there is more text? </p> <p>thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload