Home > Article > Web Front-end > How to set tr spacing in css
How to set tr spacing in css: first open the corresponding code file; then set tr as a block element; finally set the tr spacing by setting the "margin:2px 0;" style.
The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer
The distance between tr can be set by setting the margin of tr ) to implement, but note that the display attribute of tr must first be set to a block element:
tr{ display:block; /*将tr设置为块体元素*/ margin:2px 0; /*设置tr间距为2px*/ }
or
tr{ line-height:10px; 或者 margin-top:10px; }
Extended information:
Cascading style sheets are a computer language used to express document styles such as HTML or XML. CSS can not only statically modify web pages, but can also cooperate with various scripting languages to dynamically format various elements of web pages.
CSS can perform pixel-level precise control over the layout of element positions in web pages, supports almost all font size styles, and has the ability to edit web page objects and model styles.
Recommended learning: "css video tutorial"
The above is the detailed content of How to set tr spacing in css. For more information, please follow other related articles on the PHP Chinese website!