css中repeat 和 round 的区别

html-css05

css中repeat 和 round 的区别,第1张

css中no-repeat一般用在元素backgroud-repeat的设置中,含义为不平铺;

一般与background-image 一起使用;

此图片做背景时不平铺;

另外还有几个其他值:

repeat:平铺

repeat-x:横向平铺

repeat-y:纵向平铺

在CSS中,background-repeat 属性设置是否及如何重复背景图像。

示例代码:

<html>

<head>

<meta charset="utf-8"> 

<title>示例</title>

<style>

body

{

    background-image:url('paper.gif')

    background-repeat:inherit//repeat,repeat-x,repeat-y,no-repeat

}

</style>

</head>

 

<body>

<p>inherit</p>

</body>

</html>

1、background-repeat:repeat 是默认属性,使背景图像在水平和垂直方向上重复。

2、background-repeat:repeat-x 背景图像将在水平方向重复。

3、background-repeat:repeat-y 背景图像将在垂直方向重复。

4、background-repeat:no-repeat 背景图像将仅显示一次。

5、background-repeat:inherit 规定应该从父元素继承 background-repeat      属性的设置。