Material Design Lite - Bottom Line in text field has a slight gap with colored line

后端 未结 1 1680
不知归路
不知归路 2021-01-13 12:24

I am trying to get Material Design Lite text field to work and I have an issue where the bottom colored line has a slight 3-4 px gap between the gray starting line. Any MDL

相关标签:
1条回答
  • 2021-01-13 12:48

    I did face the same issue with MDL when used with boostrap and turns out the boostrap css file adds a margin of 5px to its bottom for the Label elment which creates a 5px gap.

    JSFiddle-Recreating the issue

    Code snippet from Bootstrap.css file

    label {
      display: inline-block;
      max-width: 100%;
      margin-bottom: 5px;
      font-weight: bold;
    }
    

    Fix would be reduce the margin-bottom of the label element to 0px.

    Fix- JsFiddle

    .mdl-textfield__label{  
       margin-bottom:0px;
     }
    

    Hope this helps.

    0 讨论(0)
提交回复
热议问题