Home  >  Article  >  Web Front-end  >  How to eliminate block elements in css

How to eliminate block elements in css

coldplay.xixi
coldplay.xixiOriginal
2021-03-17 17:23:463521browse

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.

How to eliminate block elements in css

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn