黑马程序员_css study notes(Sorted from w3cschool)1

---------------------- android培训java培训、期待与您交流! ---------------------- 

1Background Properties

Property

Description

Value

background

Sets all the background properties in one declaration

background-attachment

Sets whether a background image is fixed or scrolls with the rest of the page

fixed/scroll

background-color

Sets the background color of an element

background-image

Sets the background image for an element

body {background-image:url('paper.gif');} 

background-position

Sets the starting position of a background image

background-repeat

Sets how a background image will be repeated

no-repeat/repeat/repeat-x/

repeat-y

background-position的值采用两种方式描述,数字和关键字。数字(百分比和长度描述,可以混合使用):20% 65%(表示左起上起百分比)、关键字(topcenterbottomleft,可以复合等),如:left bottom

2Text Properties

Property

Description

color

Sets the color of text

letter-spacing

Increases or decreases the space between characters in a text

line-height

Sets the line height

text-align

Specifies the horizontal alignment of text

text-decoration

Specifies the decoration added to text

text-indent

Specifies the indentation of the first line in a text-block

text-transform

Controls the capitalization of text

vertical-align

Sets the vertical alignment of an element

white-space

Specifies how white-space inside an element is handled

word-spacing

Increases or decreases the space between words in a text

Text-decoration's valuesoverlinelinet-hroughtunderlinenone

text-decoration's valuecapitalize(首字母大写)、uppercaselowercase

white-space's value:normal(Text will wrap when necessary. This is default)pre and nowrapText will never wrap to the next line.)。

There are many other properties such as font-sizefont-family。 

3Font Properties

Property

Description

font

Sets all the font properties in one declaration

font-family

Specifies the font family(字体) for text

font-size

Specifies the font size of text

font-style

Specifies the font style for text(如斜体)

font-variant

Specifies whether or not a text should be displayed in a small-caps font

font-weight

Specifies the weight of a font


4Styling Links

Links can be styled with any CSS property (e.g. color, font-family, background, etc.).

Special for links are that they can be styled differently depending on what state they are in.

The four links states are:

· a:link - a normal, unvisited link

· a:visited - a link the user has visited

· a:hover - a link when the user mouses over it

· a:active - a link the moment it is clicked

Example1

Example2

a:link {color:#FF0000;}      /* unvisited link */
a:visited {color:#00FF00;}  /* visited link */
a:hover {color:#FF00FF;}  /* mouse over link */
a:active {color:#0000FF;}  /* selected link */

Example3

5List Properties

a:link {text-decoration:none;}
a:visited {text-decoration:none;}
a:hover {text-decoration:underline;}
a:active {text-decoration:underline;}

a:link {background-color:#B2FF99;}
a:visited {background-color:#FFFF85;}
a:hover {background-color:#FF704D;}
a:active {background-color:#FF704D;}

Property

Description

list-style

Sets all the properties for a list in one declaration

list-style-image

Specifies an image as the list-item marker

list-style-position

Specifies if the list-item markers should appear inside or outside the content flow(列表换行时,标签显示在文本外还是内)

list-style-type

Specifies the type of list-item marker

Values for Unordered Lists

Value

Description

none

No marker

disc

Default. The marker is a filled circle

circle

The marker is a circle

square

The marker is a square

Values for Ordered Lists

Value

Description

lower-alpha

The marker is lower-alpha (a, b, c, d, e, etc.)

lower-roman

The marker is lower-roman (i, ii, iii, iv, v, etc.)

upper-alpha

The marker is upper-alpha (A, B, C, D, E, etc.) 

upper-roman

The marker is upper-roman (I, II, III, IV, V, etc.)

decimal

The marker is a number

An Image as The List Item Marker

Example1

<style type="text/css">

ul {list-style-image:url('sqpurple.gif');}

</style>

</head>

<body>

<ul>

<li>Coffee</li>

<li>Tea</li>

<li>Coca Cola</li>

</ul>

</body>

Example2

<style type="text/css">

ul.a {list-style-type:circle;}

ul.b {list-style-type:square;}

ol.c {list-style-type:upper-roman;}

ol.d {list-style-type:lower-alpha;}

</style>

</head>

<body>

<p>Example of unordered lists:</p>

<ul class="a">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

<ul class="b">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

<p>Example of ordered lists:</p>

<ol class="c">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

<ol class="d">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

</body>

---------------------- android培训java培训、期待与您交流! ----------------------

详细请查看:http://edu.csdn.net/heima

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值