position: absolute;
background-color: white ;
height:64px;
top:0;
left:50%;
width:501px;
margin-left: -250px;
}
#topp span{
display:inline-block;
width:100px;
font-size:24px;
height:32px;
}
希望每行显示5个,却四个就掉下了了width设为550倒是可以,却又空出50px...
display: There will be a character gap between the inline-block elements, and this gap causes the last one to fall down.
Solution:
1. Set font-size for the parent element: 0px;
2. Cancel the line break, like this: <span>aaaa</span><span>aaaa</ span><span>aaaa</span>continuous.
3. Use negative margin values.
4. Use float.
5. There are also methods such as letter-spacing and word-spacing.
You can take a look at the grid system of frameworks similar to bootstrap.
Set font-size: 0px to the parent element; it is very effective