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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:21:05+00:00 2026-05-27T23:21:05+00:00

I have simple problem – text input element which has specified 2 CSS attributes,

  • 0

I have simple problem – text input element which has specified 2 CSS attributes, see code below:

<input type="text" style="resize:horizontal; width:200px" />

When only resize attribute is specified, the input can be resized to any width. However, if I have width specified, the input element can be resized only wider than 200px, not shorter.

Is there a way how can I have default width specified and in the same time have input element resizable to any width? Wider or shorter than set by width attribute?

Thanks for any help in advance!

EDIT – clarification: I need input element to be resizable freely – to any width – more than 200px and less than 200px

EDIT 2 – I am preferably looking for pure CSS solution if it is 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-27T23:21:06+00:00Added an answer on May 27, 2026 at 11:21 pm

    This is pretty close to workable. You need to set size="1" as an attribute on the <input> to resize really small. The resize is controlled by input:active which overrides the base class with width: auto;. input:focus prevents it from shrinking when you tab into it to type.

    Potential issues: input:focus forces the <input> to a specific min-size, which might be larger than what it’s been resized to. You could min-width: 100% to make this a “feature” instead of an issue, giving the user more space to type. If the <input> has focus, resize is still limited by min-width, but resize is usually done post-focus (and also, mostly used to make something larger).

    Demo: http://jsfiddle.net/ThinkingStiff/jNnCW/

    HTML (with styles inline as you requested):

    <input id="text" type="text" size="1"/>
    <style>
        input {
            resize: horizontal;
            width: 200px;
        }
    
        input:active {
            width: auto;   
        }
    
        input:focus {
            min-width: 200px;
        }
    </style>    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have very simple problem. I need to create model, that represent element of
I have a simple problem but no matter what I try I can't see
I have a very simple problem which requires a very quick and simple solution
I have a simple problem (maybe) with my code... I have a facebook button
I have a simple problem: I have a main form in win-forms/c#. It has
I have this simple problem that gets an input from the user using a
I have a simple problem in php select option. The page has 5 select
Hi I have seemingly simple problem which is causing my head to hurt. I
I have a simple problem when querying the SQL Server 2005 database. I have
I have a simple problem that i cannot solve. I have a dictionary: aa

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.