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 6366847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:28:27+00:00 2026-05-25T00:28:27+00:00

I want to know if there’s a HTML/CSS only way to detect (or at

  • 0

I want to know if there’s a HTML/CSS only way to detect (or at least, show/hide some elements with pseudo classes etc.) to take action when an element’s contents overflow (in vertical only). Yes, I KNOW it can be done and I KNOW how to do it (I don’t need JS examples on this, PLEASE), I just want to know if there’s a clever way, without any javascript.

I’m trying to show a “more…” button which will appear ONLY when there’s overflow, and trying to achieve this without JS if possible.

  • 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-25T00:28:28+00:00Added an answer on May 25, 2026 at 12:28 am

    100% height solution

    Here’s a version of this solution for 100% height – so when content tries to take up more than the whole page, you get a “more…” link. This works fine in all browsers.

    http://jsfiddle.net/nottrobin/u3Wda/1/

    I’ve used JavaScript only for the “Add another row” control – for demo purpoes. There is no JavaScript used in the actual solution.

    Caveat:

    • Since the height of the user’s browser is variable, there is no way to ensure that lines won’t appear cut in half at the point of the “more” link, or that the “more” link will be completely visible.

    Original solution

    Make the container element overflow: hidden and give it a max-height. Then put your “more” link inside that container element, with position: absolute so it’s just inside that max-height. Now the “more” link won’t be shown unless the content inside the container pushes the container to its max-height.

    If you’re careful with your line-heights then you should be able to prevent any lines from being chopped in half.

    Example:
    Just enough text: http://jsfiddle.net/nottrobin/MrAKv/17/
    Too much text: http://jsfiddle.net/nottrobin/MrAKv/16/

    The shorter version will only work in browsers that support max-height:
    http://caniuse.com/#search=max-height

    If you need IE6 support, use this slightly less succinct solution:
    http://jsfiddle.net/nottrobin/MrAKv/18/
    (Disclaimer – only tested in Google Chrome)

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

Sidebar

Related Questions

I want know is there good way to detect Column DataType for Date field
I want to know if there is any way by which I can paste
I want to know if there is a better way (than what I'm currently
I want to know is there any way that I can remove duplicates from
I want to know if there is an easier way to dealy java execution.
I want know is there any way to configure a SVN over a LAN
I want to know if there is a way to parse a received email.
I know there some object has nil? method, I want to know is there
i want to know there a limitation in size for an iphone to display
I know there is this post , but I still want to know more

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.