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

  • Home
  • SEARCH
  • 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 6981257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:07:59+00:00 2026-05-27T18:07:59+00:00

display:none takes the element away from the layout flow and thus not taking up

  • 0

display:none takes the element away from the layout flow and thus not taking up space on the page but its events get disabled.

visibility:hidden hides the element, but the element still takes up space.

I need a way to hide a file input element without taking up space and responding when I call its .click() event.

Example

  • 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-27T18:08:00+00:00Added an answer on May 27, 2026 at 6:08 pm

    Simply setting opacity to 0 should work. The element won’t show up, and it wont take space either. And its events will work.

    When giving opacity, also specify the opacity counterparts of all browsers (-moz.., -webkit, filter: ..) etc.. to ensure cross-browser compatibility.

    EDIT

    Your style should look something like:

    .mydiv {
      position: absolute;
      left: 10px; /* change as needed */
      top: 10px; /* change as needed */
      opacity: 0;
    }
    

    Working demo here: http://jsfiddle.net/t2BHg/6/

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

Sidebar

Related Questions

The CSS rules visibility:hidden and display:none both result in the element not being visible.
I have a script which hides (display:none) certain divs in the list on page
Is there a way not to process fields with a display:none style ? The
Is there a way of hiding an element's contents, but keep its :before content
I currently have jquery Cycle running on a page, but not only find it
does Display:none or jquery Hide function speed up my website, i mean i'm developing
Do they set display: none or visibility: hidden ? I'm pretty sure display: none
How can I set display:none to a ul if only has a single child?
I inherited an application where display:none was used to control conditional display of input
my style is here #mybox{ display:none; } my web is here <div id='mybox'> ...

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.