thuộc tính css

Màu nền
Font chữ
Font size
Chiều cao dòng

Thuộc tính Nền (Background)

+background-attachment:Fixed|Scroll

Định Dạng Nền:Cố Định|Di Động

+background-color

Định Dạng Màu Nền

+background-image

Định Dạng Hình Nền

+background-position:top left|top center|top right|center left|center center|center right|bottom left|bottom center|bottom right|x% y%|xpos ypos

Định Dạng Vị Trí Hình Nền

+background-repeat:repeat|repeat-x|repeat-y|no-repeat

Ví dụ:

body {

background-attachment: fixed;

background-color: #00ff00;

background-image: url("stars.gif");

background-repeat: repeat;

}

Thuộc Tính Chữ (Text)

+color: rgb(255,255,0)|blue

+text-align:left|right|center|justify

+text-decoration:none|underline|overline|line-through|blink

+text-indent:length|%

+direction:ltr|rtl

+line-height:normal|number|length|%

+letter-spacing:normal|length

+text-shadow:none|color|length

+text-transform:none|capitalize|uppercase|lowercase

+unicode-bidi:normal|embed|bidi-override

+white-space:normal|pre|nowrap

+word-spacing:normal|length

Ví dụ:

p {

color: blue;

text-align: center;

text-decoration: underline;

}

Thuộc Tính Phông Chữ (Font)

+font-family:times new roman,arial,...

=>Hệ chữ

+font-size:xx-small|x-small|small|medium|large|x-large|xx-large|smaller|larger|length|%

=>Cỡ chữ

+font-stretch:normal|wider|narrower|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded

+font-style:normal|italic|oblique

=>Kiểu chữ

+font-variant:normal|small-caps

+font-weight:normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900

=>Dạng chữ

Ví dụ

body {

font-family: Arial, serif;

font-size: 10pt;

}

p {

font-variant: normal;

font-stretch: ultra-condensed;

}

p.quan-trọng {

font-style: italic;

}

p.cảnh-báo {

font-weight: bold;

}

Thuộc Tính Vành Biên (Border)

+border:border-width|border-style|border-color

Chiều Dài:độ dài|Kiểu|Màu

+border-bottom:border-bottom-width|border-style|border-color

Vành Biên Dưới Cùng:độ dài|Kiểu|Màu

+border-bottom-color:border-color

Màu Vành Biên Dưới Cùng:Màu

+border-bottom-style:border-style

Kiểu Vành Biên Dưới Cùng:Kiểu

+border-bottom-width:thin|medium|thick|length

Chiều dài Vành Biên Dưới Cùng:Mỏng|Vừa|Dày|độ dài

+border-color:color

Màu Vành Biên:Màu

+border-left:border-left-width|border-style|border-color

Vành Biên Trái:Chiều dài|Kiểu|Màu

+border-left-color:border-color

+border-left-style:border-style

+border-left-width:thin|medium|thick|length

+border-right:border-right-width|border-style|border-color

+border-right-color:border-color

+border-right-style:border-style

+border-right-width:thin|medium|thicklength

+border-style:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset

+border-top:border-top-width|border-style|border-color

+border-top-color:border-color

+border-top-style:border-style

+border-top-width:thin|medium|thick|length

+border-width:thin|medium|thick|length

Ví Dụ:

style.css

a {

color: #003c5e;

text-decoration: none;

}

a:link {

color: #003c5e;

text-decoration: none !important;

}

a:visited {

color: #003c5e;

}

a:active {

color: #003c5e;

}

a:hover {

background: url("timbay.gif");

background-position: bottom;

}

Các thuộc tính scrollbar-...chỉ được sử dụng bởi Internet Explorer

textarea {

scrollbar-darkshadow-color: #ffffff;

scrollbar-face-color: #ffffff;

scrollbar-arrow-color: #4a96ef;

scrollbar-highlight-color: #f5f5f5;

scrollbar-shadow-color: #ffffff;

scrollbar-track-color: #f5f5f5;

scrollbar-darkshadow-color: #c0c0c0;

margin: 0px;

padding: 0px;

background-attachment: fixed;

background-repeat: repeat-y;

background-image: url("bg.gif");

font-size: 11px;

color: #000000;

line-height: 130%;

font-family: Tahoma, Verdana, Arial, sans-serif;

}

Thuộc Tính viền ngoài (outline)

+outline-color:color|invert

màu của viền ngoài:màu|đảo nguợc

+outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset

kiểu viền ngoài:bình thường|chấm|gạch ngang|đặc|đôi|dảy|ghép|

+outline-width:thin|medium|thick|length

độ rộng viền:mỏng|vừa|dày|dài

Ví Dụ:

p{border: red solid thin;

outline: green dotted thick

}

p{border: red solid thin;

}

p.dotted {outline-style: dotted}

p.dashed {outline-style: dashed}

p.solid {outline-style: solid}

p.double {outline-style: double}

p.groove {outline-style: groove}

p.ridge {outline-style: ridge}

p.inset {outline-style: inset}

p.outset {outline-style: outset}

{

border: red solid thin;

outline-style: solid;

outline-color: #00ff00

}

p.one

{

border: red solid thin;

outline-style: solid;

outline-width: thick

}

p.two

{

border: red solid thin;

outline-style: solid;

outline-width: 2px

}

Thuộc Tính lề trang (margin)

+margin-top:auto|length|%

canh đỉnh:tự động| chiều dài|%

+margin-right:auto|length|%

canh phải:tự động |chiều dài|%

+margin-bottom:auto|length|%

canh đáy:tự động|chiều dài|%

+margin-left:auto|length|%

canh trái:tự động|chiều dài|%

Ví Dụ:

p.margin

{

margin: 2cm 4cm 3cm 4cm

}

p.topmargin

{

margin-top: 5cm

}

p.topmargin

{

margin-top: 25%

}

p.bottommargin

{

margin-bottom: 2cm

}

p.leftmargin

{

margin-left: 2cm

}

p.rightmargin

{

margin-right:25%

}

Thuộc Tính đệm (padding)

+padding-top:length|%

đệm đỉnh:chiều dài|%

+padding-right:length|%

đệm bên phải:chiều dài|%

+padding-bottom:length|%

đệm đáy:chiều dài|%

+padding-left:length|%

đệm bên trái:chiều dài|%

Ví Dụ:

td.test1

{

padding: 1.5cm

}

td.test2

{

padding: 0.5cm 0.5cm

}

td

{

padding-top: 2cm

}

td

{

padding-top: 10%

}

td

{

padding-bottom: 10%

}

td

{

padding-right: 10%

}

Thuộc Tính danh sách(list)

+list-style-type:none|disc|circle|square|decimal|decimal-leading-zero|lower-roman

kiểu danh sách:không có|hình tròn|hình vuông|thập phân|kiểu số o

+list-style-position:inside|outside

vị trí danh sách:bên trong|bên ngoài

+list-style-image:none|url

kiểu hình ảnh danh sách|:không có|đưòng dẩn

Ví dụ:

ul.disc

{

list-style-type: disc

}

ul.circle

{

list-style-type: circle

}

ul.square

{

list-style-type: square

}

ul.none

{

list-style-type: none

}

ol.decimal

{

list-style-type: decimal

}

ol.lroman

{

list-style-type: lower-roman

}

ol.uroman

{

list-style-type: upper-roman

}

ol.lalpha

{

list-style-type: lower-alpha

}

ol.ualpha

{

list-style-type: upper-alpha

}

ul

{

list-style-image: url('arrow.gif')

}

ul.inside

{

list-style-position: inside

}

ul.outside

{

list-style-position: outside

}

ul

{

list-style: square inside url('arrow.gif')

}

[color=#ff0000_Thuộc tính bảng(table)

+border-collapse:collapse|separate

che lấp đường viền:che lấp|ngăn cách

+border-spacing:length length

cách khoảng đường viền:dài

+caption-side:top|bottom|left|right

che lấp đường viền:đỉnh |đáy|trái|phải

+empty-cells:show|hide

ô trống:hiện|ẩn

+table-layout:auto|fixed

bố trí bảng:tự động|cố định

Ví dụ:

table.one

{

table-layout: automatic

}

table.two

{

table-layout: fixed

}

table

{

border-collapse: separate;

empty-cells: show

}

table.coll

{

border-collapse: collapse

}

table.sep

{

border-collapse: separate

}

table.one

{

border-collapse: separate;

border-spacing: 10px

}

table.two

{

border-collapse: separate;

border-spacing: 10px 50px

}

caption

{

caption-side:bottom

}

Bạn đang đọc truyện trên: Truyen2U.Pro