How to eliminate block elements in css: first set the font-size of the parent element of the [inline-block] element to 0, set [letter-spacing] and [word-spacing] to negative numbers; then set Just restore these values to normal in the [inline-block] element.
The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.
How to eliminate block elements in css:
Set the font-size of the parent element of the inline-block element to 0, and set letter-spacing and word-spacing to Negative numbers, and then restore these values to normal in the inline-block element.
ul{ font-size:0; letter-spacing:-4px; /*实际情况下 -4这个值可能还要调整*/ word-spacing:-4px; /*实际情况下 -4这个值可能还要调整*/ } ul li{ display:inline-bolck; zoom:1; font-size:12px; letter-spacing:normal; word-spacing:normal; }
Related learning recommendations: css tutorial
The above is the detailed content of How to eliminate block elements in css. For more information, please follow other related articles on the PHP Chinese website!