4.3 Default appearances 4.3默认样式

As you can see, some elements appear a certain way by default. Lists have bullet points, links are by default blue and underlined.

就像我们看到的一样:很多元素默认会显示某种样式。比如列表前面有小圆点,链接默认是有下划线并呈现出蓝色。

But this is most evident in headings. A h1 will be bigger than a h2, which is bigger than a h3, and so on.

但是这一点在标题上更加明显,h1要比h2大,h2要比h3更大。

So if you want to make your h2 bigger, should you make it a h2?

NO!

假如我们想让h2看上去更大一些,我们需要怎么办?

Remember, HTML is for content, not presentation. Don’t mix these. When writing HTML just think about creating a logical structure of content, don’t think about how it looks, think about how it is.

需要注意:HTML是网页的内容而不是表现层。大家千万不要混淆。当我们写HTML的时候,我们只需要考虑让内容结构更加合理,而不是考虑它的外观,只考虑它是什么代表什么就可以了。

Use h2 for a main subheading on a page, and use h3 for a less important heading.

在页面是使用h2做为二级标题,使用h3作为跟次级的标题。

If you want to make the h3 bigger, you should use CSS for this.

如果我们想让h3显得更大一些,我们就需要编辑CSS。

Never use the wrong element on purpose just because you want it to look a certain way.

因此如果我们想让某些元素按照某种样式展示出来,那么我们不能在HTML元素上下功夫而是应该修改CSS。

上一篇 4.4 HTML Comments 4.4 HTML注释
下一篇 4.5 Indentation and Spacing 4.5缩进和间距
AeroCore图片
AeroCore图片
AeroCore图片
AeroCore图片
AeroCore图片
最新评论
暂无评论