Why is a table not using the body font size even though I haven't set the table font size explicitly?

前端 未结 5 1656
后悔当初
后悔当初 2020-12-30 19:24

I have a problem whereby I have set the body font-size to 11px, but tables display font at 16px. I have no idea whats causing this - I have been over the CSS and the output

5条回答
  •  清酒与你
    2020-12-30 19:50

    Don't know what the reason for this is, but since my beginning with CSS & HTML 8 years ago, this was always the case, that tables don't inherit the font-size from the body. Same goes for select- and input-elements.

    So I always do something like:

    body, table, select, input {
        font-size: 12px;
        font-family: arial, tahoma, sans-serif;
    }
    

    So this is kind of a workaround, that works for me.

提交回复
热议问题