CSS

2011-07-19 阅读 35

本文是关于CSS的介绍,试着翻译了下,不足之处望多多包涵。

CSS

层叠样式表(CSS)是一种样式语言用来描述一个标记语言文档的演示语义(外观和格式)。它最常用在以HTML和XMTHL的网页样式,但是也会被用于其他XML文档中,包括XML、SVG、XUL。

CSS设计用来把文档内容(用HTML或者相似的标记语言写的)从文档描述中分离出来,包含元素如布局,颜色和字体。这种分离能够提高内容的可及性,提供更灵活的控制规范的变现特征,能够分享多种网页格式,和减少结构内容(如:允许网页设计表)的复杂性和重复性。CSS额允许相同的标记页在不同的样式中呈现不同的模式,如在银幕上,报纸,通过声音(当被以基于语言的浏览器或者屏幕阅读器读出)在基于触觉的设备。一个文本的作者可以代表性地连接到一个CSS样式,读者可以用不同的样式,在他们自己的电脑上推翻作者的样式。

CSS指定优先方案确定众多样式规则中一个特定元素。这就是所谓的层叠,优先和重要指定到规则中,使得结果是可预见的。

CSS说明书是依据万维网联盟的。互联网媒体类型(MIME type)text/css用RFC 2318以CSS的方式注册过的(1998年3月)。

原文:

CSS

Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics (the look and formatting) of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can also be applied to any kind of XML document, including plain XML, SVG and XUL.

CSS is designed primarily to enable the separation of document content (written in HTML or a similar markup language) from document presentation, including elements such as the layout, colors, and fonts.[1] This separation can improve content accessibility, provide more flexibility and control in the specification of presentation characteristics, enable multiple pages to share formatting, and reduce complexity and repetition in the structural content (such as by allowing for tableless web design). CSS can also allow the same markup page to be presented in different styles for different rendering methods, such as on-screen, in print, by voice (when read out by a speech-based browser or screen reader) and on Braille-based, tactile devices. While the author of a document typically links that document to a CSS style sheet, readers can use a different style sheet, perhaps one on their own computer, to override the one the author has specified.

CSS specifies a priority scheme to determine which style rules apply if more than one rule matches against a particular element. In this so-called cascade, priorities or weights are calculated and assigned to rules, so that the results are predictable.

The CSS specifications are maintained by the World Wide Web Consortium (W3C). Internet media type (MIME type) text/css is registered for use with CSS by RFC 2318 (March 1998).

css

更新于 2023年03月28日