Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4580962
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:51:24+00:00 2026-05-21T20:51:24+00:00

Hello I’m making a mailbox for my website and I want it to show/hide

  • 0

Hello
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:hover height are not changing together with the 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: 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;
}

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 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.</p>
    </div>  
    <div class="newsdate">  
        <span class="newsdatetext">2011-04-30 06:54:05</span>  
    </div>
</div>

and here is what I’m getting:

Normal state – this is as intended

on :hover – the min-height value in mailbox_item:hover stays the same and doesn’t get higher when the text gets bigger

on Hover

I know that I can use overflow:hidden; so the text wont overlap the other window but I wanted to show that there is more text. How can I force the min-height value to change if there is more text?

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T20:51:25+00:00Added an answer on May 21, 2026 at 8:51 pm

    You could set height:auto property on the :hover rule so that the browser correctly calculates the height when the menu item is hovered, overriding the fixed height:20px in the .mailbox_item rule. See this demo.

    Or if you want to use CSS text-overflow you could have a double hover whereby you show some of the message when hovering on the menu item and then the full message when you hover over the message – see this demo.

    You should consider the user experience of having lots of hover events. It is probably distracting to have an inbox like list of messages in which the message body shown and hidden when hovering over the message item.

    I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i want to make animation of a frame change. But i don't find
Hello again; i need to show X,Y,Risk in ListBoxes. But i can not do
Hello, I want to put custom status bar in notification window of iphone. is
Hello! I've been programming for a long time but just started developing for android,
Hello all I am working on javascript jquery and svg.I want to ask a
Hello I was wondering how I can setup several things in a constructor, but
Hello I want to get Accurate location so that i have used following link
Hello guys i have an website online wich access the database. The database access
Hello I'm making RSS reader and I'm using DOM. Now I stuck, trying to
Hello i want to make something on classes i want to do a super

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.