1

I'm using the Bootswatch Paper theme in my website and I also want to use the Floating labels as demonstrated in this fiddle: http://jsfiddle.net/wkqsqajn/

This works fine, but I now get in trouble on my own site. The css makes .form-group to be a fixed height to give space for the floating label:

.form-group {
    display: flex;
    height: 55px;
}

unfortunately this messes up my other form inputs, such as lists of checkboxes and textareas. I made another fiddle to show the trouble I'm having (try typing in the textarea): http://jsfiddle.net/ee64ef5o/2/

The problem is that the form-group gets a fixed height. Isn't it somehow possible to set the height an X-number of pixels higher than what the element normally uses, to provide space for the floating label? Or are there any other ways to solve this?

All tips are welcome!

kramer65
  • 50,427
  • 120
  • 308
  • 488
  • If you're more concerned using your form UI than its much better to wrap your form inside a `
    ` having some class and then write `form-group` class related to that container accordingly.
    – vivekkupadhyay Sep 01 '15 at 09:59
  • Using `rows="1"` instead of `rows="2"` does solves ur issue... but resizing the textarea then entails other issues... – Ahs N Sep 01 '15 at 10:06

1 Answers1

2

You could also try using a transparant border.

border-top: 10px solid transparent;

EDIT: It sort of works by giving the element height: 50%;

http://jsfiddle.net/ee64ef5o/6/

thetailor.de
  • 185
  • 2
  • 13