Here is an improved version of the solution provided by @kuhnroyal (make sure to upvote!), taking into account the possible presence of ng-required
in the inputs. Additionally, a class is provided so you can apply this style selectively:
Copy and paste the following CSS into your page:
md-input-container.floating-label-always label {
-webkit-transform: translate3d(0,6px,0) scale(.75) !important;
transform: translate3d(0,6px,0) scale(.75) !important;
-webkit-transition: width .4s cubic-bezier(.25,.8,.25,1),-webkit-transform .4s cubic-bezier(.25,.8,.25,1) !important;
transition: width .4s cubic-bezier(.25,.8,.25,1),-webkit-transform .4s cubic-bezier(.25,.8,.25,1) !important;
transition: transform .4s cubic-bezier(.25,.8,.25,1),width .4s cubic-bezier(.25,.8,.25,1) !important;
transition: transform .4s cubic-bezier(.25,.8,.25,1),width .4s cubic-bezier(.25,.8,.25,1),-webkit-transform .4s cubic-bezier(.25,.8,.25,1) !important;
opacity: 1 !important;
top: auto !important;
}
md-input-container.floating-label-always .md-select-placeholder > span:not(.md-select-icon) {
color: transparent;
}
md-input-container.floating-label-always .md-select-placeholder > span:not(.md-select-icon):after {
content: none !important;
}
To use it, simply add the floating-label-always
class to your md-input-container
.