0

I am keeping some of input elements in left column, and in the right column with only textarea, I am trying to add a height to 100% equal to left column. but for some reason it does not work.

.popup {
  border: 1px solid red;
  background: rgba(000, 000, 000, 0.4);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

form,
fieldset {
  padding: 0;
  margin: 0;
  border: 0;
}

form {
  display: flex;
  flex-wrap: wrap;
  border: 1px dotted gray;
  width: 25rem;
}

fieldset {
  width: 50%;
  background: #333;
  padding: 0.5em;
  margin: 0;
  box-sizing: border-box;
}

form label {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
}

form label input,
form label textarea {
  width: 100%;
  background: white;
  border: 1px solid gray;
}

textarea {
  border: 1px solid blue;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.submit-form {
  flex-basis: 100%;
  text-align: right;
  background: tan;
}
<div class="popup">
  <div class="pop-form">
    <form>
      <fieldset>
        <label htmlFor="name"><input type="text" name="name" id="name" /></label>
        <label htmlFor="email"><input type="email" name="email" id="email" /></label>
        <label htmlFor="phone"> 
          <input type="tel" name="phone" 
            autoComplete="off"
            placeholder="Phone" id="phone"/> </label>
      </fieldset>
      <fieldset>
        <label class="message" htmlFor="message">
          <textarea placeholder="Message" 
            autoComplete="off"
            name="message" id="message"></textarea></label>
      </fieldset>
      <div class="submit-form">
        <button>Submit</button>
      </div>
    </form>
  </div>
</div>
mplungjan
  • 169,008
  • 28
  • 173
  • 236
3gwebtrain
  • 14,640
  • 25
  • 121
  • 247

1 Answers1

5

Add this to style .message{ height:100% }. Check following code snippet.

.popup {
  border: 1px solid red;
  background: rgba(000, 000, 000, 0.4);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

form,
fieldset {
  padding: 0;
  margin: 0;
  border: 0;
}

form {
  display: flex;
  flex-wrap: wrap;
  border: 1px dotted gray;
  width: 25rem;
}

fieldset {
  width: 50%;
  background: #333;
  padding: 0.5em;
  margin: 0;
  box-sizing: border-box;
}

form label {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
}

form label input,
form label textarea {
  width: 100%;
  background: white;
  border: 1px solid gray;
}

textarea {
  border: 1px solid blue;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.submit-form {
  flex-basis: 100%;
  text-align: right;
  background: tan;
}

.message {
  height: 100%
}
<div class="popup">
  <div class="pop-form">
    <form>
      <fieldset>
        <label htmlFor="name"><input type="text" name="name" id="name" /></label>
        <label htmlFor="email"><input type="email" name="email" id="email" /></label>
        <label htmlFor="phone"> 
          <input type="tel" name="phone" 
            autoComplete="off"
            placeholder="Phone" id="phone"/> </label>
      </fieldset>
      <fieldset>
        <label class="message" htmlFor="message">
          <textarea placeholder="Message" 
            autoComplete="off"
            name="message" id="message"></textarea></label>
      </fieldset>
      <div class="submit-form">
        <button>Submit</button>
      </div>
    </form>
  </div>
</div>
Nik
  • 1,589
  • 2
  • 15
  • 23
WiatroBosy
  • 1,076
  • 1
  • 6
  • 17