Border Radius of Table is not working

后端 未结 7 864
谎友^
谎友^ 2020-12-13 02:12

I want to add a border radius around the entire table. But the following code is not working in both the latest versions of Firefox and Google Chrome.

HTML

7条回答
  •  佛祖请我去吃肉
    2020-12-13 02:43

    It works, this is a problem with the tool used: normalized CSS by jsFiddle is causing the problem by hiding you the default of browsers...
    See http://jsfiddle.net/XvdX9/5/

    EDIT:
    normalize.css stylesheet from jsFiddle adds the instruction border-collapse: collapse to all tables and it renders them completely differently in CSS2.1:

    • The separated borders model
    • The collapsing border model

    Differences between the 2 models can be seen in this other fiddle: http://jsfiddle.net/XvdX9/11/ (with some transparencies on cells and an enormous border-radius on the top-left one, in order to see what happens on table vs its cells)

    In the same CSS2.1 page about HTML tables, there are also explanations about what browsers should/could do with empty-cells in the separated borders model, the difference between border-style: none and border-style: hidden in the collapsing borders model, how width is calculated and which border should display if both table, row and cell elements define 3 different styles on the same border.

提交回复
热议问题