Twitter Bootstrap text field's height too small?

后端 未结 5 1760
孤独总比滥情好
孤独总比滥情好 2021-01-31 13:09

I am using bootstrap and i find the height of the text field is too small.It\'s like less than 10px.I am wondering if it is small or i made some mistakes.

I used firebug

相关标签:
5条回答
  • 2021-01-31 13:57

    Adding <!DOCTYPE HTML> should fix this. The same question was asked here: Text input rendering issue with Twitter Bootstrap

    0 讨论(0)
  • 2021-01-31 13:58

    Incase the top answer didn't help

    I had <!DOCTYPE html> already and it wasn't the problem for me. I don't know what is the problem, but I fixed it with this in my css:

    input[type=text], input[type=password], input[type=email], input[type=tel] {
        height: 28px !important;
    }
    

    It's a workaround and I'm not sure if it has some side effects.

    0 讨论(0)
  • 2021-01-31 14:09

    I don't know why if I open a clean new HTML5 page it works but after I add some code I don't know why it happens. So I just open the bootstrap.min.css file and search:type="text" and there there is height property and I change it to min-height for it have to be working.

    0 讨论(0)
  • 2021-01-31 14:10

    See my solution here in a similar thread.

    Basically, the text file encoding was causing all my trouble. It manifested in such minute differences across browsers that I wasted hours fiddling with CSS thinking that was the cause.

    0 讨论(0)
  • 2021-01-31 14:12

    Yes the total height is 28px because padding & border also add height to that input like this:

    height 18px + 
    4px padding-top + 
    4px padding-bottom + 
    1px border-top + 
    1px border-bottom = 
    Total 28px height
    
    0 讨论(0)
提交回复
热议问题