We often use display:inline-block in web layouts; The advantage is that you can arrange block elements as inline elements and set the width and height. Personal feeling is very easy to use, but with more slowly came the problem?
1.display:inline-block; Not compatible in IE6/7
Display :inline-block; *dsiplay:inline; *zoom:1;
2.display:inline-block; There will be an unknown gap (4px)
Reason: A newline or space can take up space and create a gap,
Solutions:
1. Remove whitespace or newline from the current element in the HTML code. This method is too cumbersome and affects the readability of the HTML code.
Font-size :0; font-size:0; font-size:0; This is essentially the same as the 1 method, but may not be supported in Chorme
3. Set letter-spaceing:-4px in the parent element of the current element; The effect is to control the horizontal distance between the text, allowing the text to overlap horizontally (line-height is the text to overlap vertically), thus cancelling out space space or newlines.
Conclusions are as follows:
» the inline – after the block, block level elements IE6/7 no newline gap problem, other browsers have;
» after the inline – block, the level of the inline elements, all major browsers have a newline/space gap problem;
> font-size:0; font-size:0; font-size:0; font-size:0; font-size:0; font-size:0;
» spacing is removed from all browsers by the let-spacing negative value. However, Opera’s spacing limit is 1 pixel. 0 pixels will bounce back and the spacing will be restored.
Recommended solutions:
Font-size :0; letter-spaceing:-4px;
Floating Layout – List Layout Based on Display: Inline-Block
Reproduced in: https://www.cnblogs.com/jesse131/p/4872721.html
Read More:
- Solution to the problem that the camera can’t display when ROS running
- Built on Ethereum, puppeth cannot be used to create the initial block, and an error is reported Fatal: Failed to write genesis block: unsupported fork ordering: eip15
- Solution to “error: invalid environment block” when Ubuntu starts up
- ORA-19502: write error on file “”, block number (block size=)
- Python problem: indenta tionError:expected an Error resolution of indented block
- The solution of PDF file unable to display thumbnail in win7
- Solve the problem of “error empty block statement no empty” in the console (Vue project)
- Solution to display CPU over voltage error when Windows system starts
- Solve the problem that “figure size 640×480 with 1 axes” does not display pictures in jupyter notebook
- Solution to the incomplete display of the principle icon number exported by smartpdf in Ad
- Python Anaconda Spyder can’t display pictures by using Matplotlib. Error report solution: figures now render in the plots pane by default. To mak
- Solution to the incomplete display of big data files printed by pychar
- Android 9 (P) recovery upgrade Map of ‘@/cache/recovery/block.map’ failed problem analysis guide
- Vs code solves the problem that latex does not display references and [?] is displayed in the text
- Open the top left corner of the chrome page to display the volume and playback chrome.exe Problem solving
- Solution of Chinese display garbled code in Git Bash
- Matlab 2016a installation activation, start display license manager error-8, solution?
- Win10 desktop right click display settings MS- settings:display Or Ms- settings:personalization-background resolvent
- Solution to the problem that SQL database query result field contains new line character, which leads to copy to excel dislocation
- Inline JavaScript is not enabled. Is it set in your options?