Web Quality - Stylesheets

使用样式表对于提升网页品质至关重要。

请勿使用 font 标签

应使用 CSS 来设置显示网页上的字体尺寸。请不要使用 font 标签。

使用 标签会增加文档的规模,而且使您每次改变标准文字尺寸的工作成为一场梦魇。

请设想一下下面的情况:

一天您决定修改网站中所有标题的颜色和尺寸。通过 CSS,您只需要修改一行就可以做到这一点。假如您使用了 标签,那么您需要把网站中所有页面的所有标题都修改一遍。

使用样式替代 标签可使我们更轻松地为网页制作高质量的界面。

Do not use fixed font sizes

Do not use fixed size values. Always use relative size values.

The most important reason for this suggestion is that the fixed size cannot be adjusted through the browser.

Your visitors will use different devices (displays), different browsing environments (light), and possible disabilities (weak vision).

For example, you can set someone's text size to 100% (or medium), the main title to 140% (or x-large), and the secondary title to 120% (or large), so that users can use the browser to reset their favorite size.

By adjusting the text size of the web page, you can also change the number of words on the printed page.

Do not use very small default font sizes

Some websites use very small text sizes so that more content can be

Reiterate again, using different devices (displays), different browsing environments (light), and possible disabilities (weak vision) may cause reading difficulties for users.

Please do not force users to resize the text size every time they visit your site.

Always use consistent background colors

Most web pages will use colors for different text elements. The color of titles and links is usually different from the color of the body text.

As a web designer, you should be aware of the fact that your visitors can change the default color options.

If you define a color for web elements, then you should also define a background color.

If you do not define a background color, then your website may be ruined by poor color combinations (such as bright red text on a red background, or dark text with a dark background).

If you do not specify a background color, it may make the text difficult to recognize.