• 18191阅读
  • 5回复

[css]CSS是什么东西[supfrie] [复制链接]

上一主题 下一主题
离线XChinux
 

只看楼主 倒序阅读 楼主  发表于: 2005-07-30
CSS是Cascading Style Sheet 的缩写。译作「层叠样式表单」。是用于(增强)控制网页样式并允许将样式信息与网页内容分离的一种标记性语言。
如何将样式表加入您的网页
你可以用以下三种方式将样式表加入您的网页。而最接近目标的样式定义优先权越高。高优先权样式将继承低优先权样式的未重叠定义但覆盖重叠的定义。链入外部样式表文件 (Linking to a Style Sheet)
你可以先建立外部样式表文件(.css),然后使用HTML的link对象。示例如下:
<head>
<title>title of article</title>
<link rel=stylesheet href="http://www.sqlasp.net/main.css" type="text/css">
</head>

而在XML中,你应该如下例所示在声明区中加入:
<? xml-stylesheet type="text/css" href="http://www.sqlasp.net/main.css" ?>>
定义内部样式块对象 (Embedding a Style Block)
你可以在你的HTML文档的<HTML>和<BODY>标记之间插入一个<STYLE>...</STYLE>块对象。 定义方式请参阅样式表语法。示例如下:
<html>
<style type="text/css">
<!--
body {font: 10pt "Arial"}
h1 {font: 15pt/17pt "Arial"; font-weight: bold; color: maroon}
h2 {font: 13pt/15pt "Arial"; font-weight: bold; color: blue}
p {font: 10pt/12pt "Arial"; color: black}
-->
</style>
<body>
请注意,这里将style对象的type属性设置为"text/css",是允许不支持这类型的浏览器忽略样式表单。
内联定义 (Inline Styles)
内联定义即是在对象的标记内使用对象的style属性定义适用其的样式表属性。示例如下:
<p style="margin-left: 0.5in; margin-right:0.5in">这一行被增加了左右的外补丁<p>
样式表语法 (CSS Syntax)
Selector { property: value }
参数说明:
Selector -- 选择符
property : value -- 样式表定义。属性和属性值之间用冒号(:)隔开。定义之间用分号(;)隔开
继承的值 (The ' Inherit ' Value)
每个属性都有一个指定的值:Inherit。它的意思是:将父对象的值等同为计算机值得到。这个值通常仅仅是备用的。显式的声明它可用来强调。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线XChinux

只看该作者 1楼 发表于: 2005-07-30
字体 Font

font color font-family font-size font-size-adjust font-stretch font-style font-weight text-decoration text-underline-position text-shadow font-variant text-transform line-height letter-spacing word-spacing
文本 Text

text-indent text-overflow vertical-align text-align layout-flow writing-mode direction unicode-bidi word-break line-break white-space word-wrap text-autospace text-kashida-space text-justify ruby-align ruby-position ruby-overhang ime-mode layout-grid layout-grid-char layout-grid-char-spacing layout-grid-line layout-grid-mode layout-grid-type
背景 Background

background background-attachment background-color background-image background-position background-positionX background-positionY background-repeat layer-background-color layer-background-image
定位 Positioning

position z-index top right bottom left
尺寸 Dimensions

height max-height min-height width max-width min-width
布局 Layout

clear float clip overflow overflow-x overflow-y display visibility
外补丁 Margins

margin margin-top margin-right margin-bottom margin-left
轮廓 Outlines

outline outline-color outline-style outline-width
边框 Borders

border border-color border-style border-width border-top border-top-color border-top-style border-top-width border-right border-right-color border-right-style border-right-width border-bottom border-bottom-color border-bottom-style border-bottom-width border-left border-left-color border-left-style border-left-width
内容 Generated Content

include-source quotes content counter-increment counter-reset
内补丁 Paddings

padding padding-top padding-right padding-bottom padding-left
列表项目 Lists

list-style list-style-image list-style-position list-style-type marker-offset
表格 Table

border-collapse border-spacing caption-side empty-cells table-layout speak-header
滚动条 Scrollbars

scrollbar-3d-light-color scrollbar-highlight-color scrollbar-face-color scrollbar-arrow-color scrollbar-shadow-color scrollbar-dark-shadow-color scrollbar-base-color
打印 Printing

page page-break-after page-break-before page-break-inside marks orphans size widows
声音 Aural

voice-family volume elevation azimuth stress richness speech-rate cue cue-after cue-before pause pause-after pause-before pitch pitch-range play-during speak speak-numeral speak-punctuation
其它属性 Classification

behavior zoom cursor filter
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线XChinux

只看该作者 2楼 发表于: 2005-07-30
时间单位 Time Units

s   ms
长度单位 Length Units

em   ex   px   pt   pc   in   cm   mm
频率单位 Frequency Units

kHz   Hz
颜色单位 Color Units

#RRGGBB   rgb ( R,G,B )   Color Name
角度单位 Angle Units

deg   grad   rad
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线sunyilong
只看该作者 3楼 发表于: 2008-07-24
CSS中的好多属性不知该如何用到QT控件中,LZZ能否给点指导。
离线lee51525125
只看该作者 4楼 发表于: 2008-08-07
qt 中怎样 用qss呢?
离线huishouliu
只看该作者 5楼 发表于: 2009-02-04
请问下qt/em(嵌入式版本)支持CSS样式吗?
MSN/Email :huishouliu@126.com
快速回复
限100 字节
 
上一个 下一个