css - 设置font-family全局字体对网页布局会产生影响?
怪我咯
怪我咯 2017-04-17 14:46:12
0
2
695

我在学习慕课网的网页布局基础时碰到这样的问题,相同的html和css代码,设置font-family之前是这样:

在设置了*{font-family:Arial, Helvetica, sans-serif,"宋体";}这条css之后就变成了这样:

刚开始学习 html+css ,很迷惑。

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
迷茫

is usually written in a structure like ul>li, and then the li of display is set to inline-block, and it is reversed. However, there is usually at least one line break between li and li, such as:

<ul>
    <li>A</li>
    <li>B</li>
</ul>

This kind has line breaks, unless you write:

<ul><li>A</li><li>B</li></ul>

Otherwise, the newline character will cause a gap between li, which is the reason for the newline problem in Figure 1.
(Master Zhang Xinxu mentioned this in his blog, I suggest you read it~)
And if a global font is set, one possibility is to make the line breaks "thinner", so the second line will be Pull up.

PHPzhong

Guess: Try removing the spaces and line breaks between tags like ul and li in your html.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!