CSS-related knowledge Ⅱ

Then on a round-up of some css knowledge

(I) Background

Background Properties

1.background-color function sets the background color rgb

2.background-image background image url ( "logo.jpg")

Url add a function that brackets, double quotes with the parameter is added to the full path of the image of the background image (relative path) and a file name.

Background fill 3.background-repeat manner (filled tessellated)

⑴ value of repeat, as a background image to fill the entire page.

⑵ value of repeat-x, unidirectional fill, horizontal fill line.

⑶ value of repeat-y, filling way, a vertical filling.

⑷ value of no-repeat, all the above components are provided with a uniform background property. Order: background color, background image, refillable way

 

(Ii) a hyperlink

Four states link

1.a: link normal, unvisited links

2.a: the user has visited visited links

3.a: hover the mouse pointer above the link hover

4.a: active link is clicked the moment (in the activated state is clicked)

The four way link is called pseudo-class selectors

 

After visited: 1, the order of: ⑴.a: hover: must be in a: link and .a

                 After hover: ⑵a: active: you must be in a

2.css hyperlinks, hover enlarge font

 

(Iii) a list of list

Ul unordered lists and ordered lists ol common style

   Attribute Description

1.list-style property for a list of all the settings in a statement

2.list-style-image as the list item flag image

Location 3.list-style-position mark

Type 4.list-style-type logo

 

*list-style-type  的相关属性值

 

㈣表格 table

1.表格大小:width(宽),height(高)

2.表格边框:border属性,table,td,th,border-collapse属性

3.border-collapse属性

例如:table{border-collapse:collapse;} 为叠加或坍缩的意思,这样表格边框和单元格边框就重叠成一个了。

4.奇偶选择器:    :nth-child(odd/even)   odd:奇数个元素  even:偶数个元素

例如:tr:nth-child(odd){background-color:#EAF2D3;}

奇偶选择器常在下面表格样式隔行设置不同颜色中应用

注意:⑴奇数个是从第一行开始设置的(tr父元素table的第一个子元素开始,奇数个元素)

           ⑵第一行为表头单元格,加入th标签来进行设计。

 

  希望有所帮助。

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/shihaiying/p/11241657.html