Twitter's Bootstrap - Form Inputs Too Thin

后端 未结 5 783
难免孤独
难免孤独 2020-12-30 02:33

I\'m using Twitter\'s Bootstrap to create the HTML/CSS for my website. I run into a problem when creating the forms, however:

相关标签:
5条回答
  • 2020-12-30 02:58

    Damnit. I was missing

    <!DOCTYPE html> 
    

    at the top of the document.

    0 讨论(0)
  • 2020-12-30 03:00

    Ok, I had the same problem and after weeks searching for a solution, this guy solved my problem!

    getting application.css to override bootstrap

    1 - create the file assets/stylesheets/my_styles.css.scss

    2 - put the code bellow in my_styles.css.scss file:

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

    3 - In assets/stylesheets/application.css, put this:

    *= require my_styles   
    

    after bootstraps require... in my case it is:

    *= require font-awesome
    *= require bootstrap_sb_admin_base_v2
    *= require_self
    *= require my_styles
    *= require_tree .
    */   
    

    Hope it helps someone in trouble!

    0 讨论(0)
  • 2020-12-30 03:05

    The <!DOCTYPE html> fix did not work for me. But what helped was finding and removing following in our codebase:

    *, *:before, *:after {
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
    }
    
    0 讨论(0)
  • 2020-12-30 03:14

    I had this problem and drove me mad for hours as the cause was completely invisible. I already had the <!DOCTYPE html> there and all the code was perfect. The problem turned out to be the text file encoding.

    Using the linux 'file' command showed the source file coded as: "PHP script, UTF-8 Unicode (with BOM) text".
    Running 'more' on the file showed some garbage chars () at the start of the files. I created new files within linux and copied/pasted the code in and everything started working as expected.

    0 讨论(0)
  • 2020-12-30 03:16

    What fixed it for me was adding class="form-control" to the input.

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