How did this site add that 2px margin between the th elements?

允我心安 提交于 2019-12-11 13:24:08

问题


I've been looking at the code and I still can't figure out how they achieved the 2px margin between the th elements:

This is the site: http://ecigarettereviewed.com/

Any ideas?


回答1:


Here's the relevant CSS:

table {
    border-collapse: separate;
    border-spacing: 2px;
}

This is actually a browser default style:




回答2:


I believe this is the CSS that causes those borders:

table {
    border-collapse: separate;
    border-spacing: 2px;
    -webkit-border-horizontal-spacing: 2px;
    -webkit-border-vertical-spacing: 2px;
}


来源:https://stackoverflow.com/questions/15562679/how-did-this-site-add-that-2px-margin-between-the-th-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!