html - show/hide with CSS -
hello
i'm making mailbox website , want show/hide css3 know there few tutorial etc on how it, tried bit differently. i'm getting result, there 1 issue. when hover on item item:hover
height not changing text:
styles.css:
.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: 0s ease-in-out; -moz-transition: 0s ease-in-out; -o-transition: 0s ease-in-out; -ms-transition: 0s ease-in-out; transition: 0s ease-in-out; } .mailbox_item_top { min-height: 20px; line-height: 13px; } .mailbox_item_body { min-height: 20px; }
item.php
<div class="mailbox_item"> <div class="mailbox_item_top"> <h2 class="titleannouncement">test announcement</h2> <span class="mail_author">0</span> </div> <div class="mailbox_item_body"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam dapibus lacinia dui @ mattis. donec vitae tellus congue leo egestas tincidunt eget lorem. fusce et varius velit. in sollicitudin porta arcu, vel convallis mauris varius ut. aenean id risus 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 @ urna tincidunt tempor. nam sodales lectus sem sodales congue. suspendisse ut ultricies nunc. aenean blandit tempor ipsum lacinia tincidunt. mauris ut ipsum non dolor luctus volutpat. cras quis enim @ 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.</p> </div> <div class="newsdate"> <span class="newsdatetext">2011-04-30 06:54:05</span> </div> </div>
and here i'm getting:
normal state - intended
on :hover - min-height
value in mailbox_item:hover stays same , doesn't higher when text gets bigger
i know can use overflow:hidden;
text wont overlap other window wanted show there more text. how can force min-height
value change if there more text?
thanks in advance
you set height:auto
property on :hover
rule browser correctly calculates height when menu item hovered, overriding fixed height:20px
in .mailbox_item
rule. see this demo.
or if want use css text-overflow
have double hover whereby show of message when hovering on menu item , full message when hover on message - see this demo.
you should consider user experience of having lots of hover events. distracting have inbox list of messages in message body shown , hidden when hovering on message item.
i hope helps.
Comments
Post a Comment