Font-Size for Button and Link

后端 未结 4 1969
生来不讨喜
生来不讨喜 2021-01-02 07:31

I tried this simple html:

TEST FONT SIZE
相关标签:
4条回答
  • 2021-01-02 07:34

    The font-size is the same. But it looks different because the default page font is different from the default input-field font. Set the font-family on both elements the same and they'll look the same.

    I usually do:

    body, input, button, select, option, textarea {
        font-family: ...; /* whatever font */
    }
    body {
        font-size: x%; /* whatever base font size I want */
    }
    input, button, select, option, textarea {
        font-size: 100%;
    }
    

    to get consistent fonts over the page and form fields.

    0 讨论(0)
  • 2021-01-02 07:37

    Had the same problem in Chrome, later figured out that key cause was

    body {
        -webkit-font-smoothing: antialiased
    }
    

    changing this to

    body {
        -webkit-font-smoothing: subpixel-antialiased;
    }
    

    fixed it.

    0 讨论(0)
  • 2021-01-02 07:56

    You should not use much CSS for buttons, because their display depends on the users operating system.

    Instead you can use for example images.

    0 讨论(0)
  • 2021-01-02 07:57

    Looks the same to me, tested on Firefox, IE6 and Chrome: http://jsbin.com/oveze
    Please keep in mind:

    • This depends on the browser and its defaults, and may also be different depending on the operating system.
    • Very often there's a different font for buttons and input fields. Set it too.
    • Anti-aliasing or ClearType can cause a slight difference when you don't have the same colors (background and font).
    0 讨论(0)
提交回复
热议问题