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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:34:55+00:00 2026-06-12T06:34:55+00:00

<div id=d1> <div id=d2>label</div> <div id=d3><input name=t1 id=t1 type=text /></div> <div id=d4>Message</div> </div> #d1

  • 0
<div id="d1">
  <div id="d2">label</div>
  <div id="d3"><input name="t1" id="t1" type="text" /></div>
  <div id="d4">Message</div>
</div>
  • #d1 and #d2 has fixed width.
  • #d4 can be displayed or hidden (visibility: visible; or visibility: hidden;). When it’s visible, it has fixed width.

I want that #d3 have a variable width, so it can fill the remaining right space of #d1 when #d4 is hidden, but when #d4 is visible, fill the space between #d2 and #d4.

How can achieve this using CSS?

  • 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-06-12T06:34:56+00:00Added an answer on June 12, 2026 at 6:34 am

    I came up with something that slightly alters your HTML structure:

    <div id="d1">
        <div id="d2">label</div>
        <div id="d4">Message</div>
        <div id="d3"><input name="t1" id="t1" type="text" /></div>
    </div>
    

    ​CSS:

    input { width: 100%; }
    #d2 { 
        float: left; 
        display: inline-block; }
    #d4 { 
        float: right;
        display: inline-block; }
    #d3 { 
        padding: 0 10px; 
        overflow: hidden; }
    ​
    

    Preview: http://jsfiddle.net/Wexcode/HLME4/

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

Sidebar

Related Questions

I have input text: <div><label wicket:for=name>Name</label><input type=text wicket:id=name /></div> Now I need to add
<div class=field50Pct> <div class=fieldItemLabel> <label for='First Name'>First Name:</label> </div> <div class=fieldItemValue> <input type=text id=firstname
Here's my scenario: <!-- Normal Control --> <div class=required> <label for=address1>Address line 1</label> <input
foreach($apps as $app){ echo $this->Form->input('Application', array('type'=>'checkbox', 'id'=>$app['Application']['description'], 'div'=>false,'type'=>'checkbox','value' => $app['Application']['description'],'label'=>$app['Application']['description'])); } <div class=checkboxes> <input
I have this form: <form> <div class=box> <h1>Contact form :</h1> <label> <span>Typ: </span> <input
html structure: <form method=post id=comment-form accept-charset=UTF-8> <div class=form-item form-type-textfield form-item-name> <input type=text id=edit-name name=name
If I have a drop down list as follows <div class=editor-label> <%= Html.DropDownListFor(model =>
Afternoon all. I have a drop down list in my view <div class=editor-label> @Html.LabelFor(model
I am finding tough to align the label and textboxes using Div's. If I
Ok, I have a label, inside this label is a div, which contains an

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.