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

How to eliminate block elements in css

coldplay.xixi
Release: 2023-01-03 09:30:21
Original
3546 people have browsed it

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;
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template