当前位置: 首页 > 网络学院 > 设计教程 > 设计理念 > 样式表

设计理念
图形简介:第一部分
图形简介:第二部分
图形简介:第三部分
图形简介:第四部分
网站规划101
通过网络赚取客户的信任
网站配色:第一部分
网站配色:第二部分
CGI剖析:第一部分
CGI剖析:第二部分
CGI剖析:第三部分
下拉表单:第一部分
下拉表单:第二部分
下拉表单:第三部分
网站设计公司:第一部分
网站设计公司:第二部分
Web 标准
HTML 元素
样式表
Web 易读性

设计理念 中的 样式表


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 1586 ::
收藏到网摘: n/a

Using Style Sheets is important to web page quality.
使用样式表对于提升网页品质来说至关重要。


Don't Use the Font Tag
不要使用字体标签

The text size used to display information on a web page should be set using CSS (Cascading Style Sheets). Do not use the HTML <font> tag.
用于在网页中显示信息的字体尺寸大小应该使用CSS来设置。不要使用HTML的<font>标签。

Using the <font> tag will increase the size of your document, and give you a nightmare every time you decide to change your standard text size.
使用<font>标签会增加文档大小,并且,当你改变标准字体尺寸时,它会给你带来恶梦般的结果。

Think of the following example:
考虑下面的案例:

One day you decide to change all the headers in your web to another color and another size. With CSS you can change the color and size attributes by rewriting one line of code. If you have used the <font> tag, you will have to edit the <font> tag for all the headers in all the pages of your web.
一天,你决定将页面中的所有抬头改变成其它的颜色和尺寸。通过CSS,你可以书写一段代码来改变颜色和字体尺寸的属性。如果你已经使用了<font>标签,你将在整个网络页面中为所有的抬头编辑<font>标签。

lamp.gif Using styles instead of <font> tags makes it much easier to give all the pages of your web a high quality and consistent look.
使用样式表来代替<font>标签可以给整个页面带来高质量和持续的可视性。


Don't Use Fixed Sizes
不要使用固定尺寸

Never use fixed size values. Always use relative size values.
不要使用固定的尺寸值。尽量使用相对的尺寸值。

The most important reason for this advice is that fixed sizes can not be resized by the browser.
最重要的理由就是,固定的尺寸不能根据浏览器来进行尺寸修改。

Your visitors will have different equipment (monitors), different viewing conditions (light), and possible disabilities (poor eyesight).
你的访问者可能使用了不同的设备(显示器),不同的浏览状态(灯光),或者是残疾的(弱视)。

Setting your default text size to 100% (or medium), your main headers to 140% (or x-large), your sub headers to 120% (or large), as an example, will make it possible for your reader to resize your pages to their best fit.
把字体尺寸设置为100%(或者 medium),你的主要抬头标题140% (或 X-large)。你的二级标题120%(或者 large)。举个例子来说,它可以使你的阅读者重新制定那些适合他们的页面尺寸大小。

Want to see how it works? Select view in your browsers menu, and change the text size for this page.
你想知道它的工作原理?在你的浏览器菜单中选择查看,然后改变整个页面的文本大小。

lamp.gif Adjusting the text size of a web page also changes the amount of text that will fit on a printed page.
改变页面的文本大小也会改变页面显示的文字的数量。


Don't Use a Small Default Font Size
不要使用默认的小字体

Some web sites use a small text size just to "squeeze" more text into each page, or to make the page more "stylish".
一些网站企图使用小字体,目的是使一页能够显示更多的文字,或者使页面看上去更加“时髦”。

Again, visitors with different equipment, viewing conditions, and disabilities (and sometimes most people) will have difficulties reading the text.
在者,拥有不同设备的、浏览状况和不同能力的(有时是大多数人)访问者将会在文本的阅读上碰到困难。

lamp.gif Don't force your visitors to enlarge the text size every time they visit your site.
不要强制你的访问者在阅读你的站点时扩大字体尺寸。


Always Use a Background Color
总是使用背景色

Most web pages use colors for different text elements. Both headers and links are often in a different color from the body text.
大多数网页使用不同颜色的字体。并且,标题和链接的颜色通常与页面主体本身的字体颜色不同。

As a web designer, you should be aware of the fact that your visitors are able to change their default color preferences.
作为一个网页设计师来说,你应该注意到访问者能够改变默认颜色参数的情况。

If you define colors for your web elements (like header and links), you should also define the background color.
如果你为你的网络元素定义了颜色(如:标题和链接),那么你也应该定义背景色。

If you don't define a background color, your web site might end up with some very bad combination of colors (like light red headers on a red background, or even worse, black text on a black background)
如果你没有定义背景色,那么你的站点就会看上去颜色混乱一团糟(就像是7个淡红色标题,下面是红色背景;甚至是更糟,黑子黑底)。

lamp.gif If you don't specify a background color, your text might be invisible.
如果你没有指定背景颜色,那么你的文字应该是不可见的。

评论 (0) All

登陆 | 还没注册?