backgroundimage平铺-image:ur...

想问一下background-image:none,url(../images/logo.svg?ver=)中的ver=的作用是什么_百度知道Can I use CSS3 Background-image options
Green = Supported
Red = Not supported
Greenish yellow = Partial support
Gray = Support unknown
Global usage
New properties to affect background images, including background-clip, background-origin and background-size
Popular versionsAll versionsIE5.567891011Edge121314Firefox233.53.6456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051Chrome45678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455Safari3.13.2455.166.177.1899.110TPOpera99.5-9.610.0-10.110.510.61111.111.511.61212.1151617181920212223242526272829303132333435363738394041iOS Safari3.24.0-4.14.2-4.35.0-5.16.0-6.17.0-7.188.1-8.49.0-9.29.3Opera MiniallAndroid Browser2.12.22.3344.14.2-4.34.44.4.3-4.4.451Blackberry Browser710Opera Mobile101111.111.51212.137Chrome for Android51Firefox for Android47IE Mobile1011UC Browser for Android9.9Samsung Internet4Other Stuff
More Stuff
&& Background Style &&
Background colors and images can be placed as a main page background, a table or cell background, or even a text background.
Both of the background-color and background-image properties can be specified for ANY regular HTML tag.
Background Color
background-color is used to specify the main background color of the page. It can also be used on regular or linkied text.
This shows how to declare a WHITE background for the main page area using embedded CSS :
&style type=&text/css&&
body {background-color: #ffffff;}
Now, add in a command line that will create a red background color for any text within an h3 tag set :
&style type=&text/css&&
body {background-color: #}
h3 {background-color: #ff0000;}
And add in a CLASS command to create a BLUE background when it is used in the main BODY code area :
&style type=&text/css&&
body {background-color: #}
h3 {background-color: #ff0000;}
.blueback {background-color: #0000ff;}
The main area of the page will be white. Any text or objects within an h3 tag set will now have a red background behind them. Any text or objects within an HTML tag using the class=&blueback& will have a blue background behind them.
Background Image
Images can be used for backgrounds as well. They can be used behind text or objects as well as the main background.
Using the example from above, add in an image to show as the background. Since there are some non-image capable browsers, it's best to leave the color property in as well.
&style type=&text/css&&
body {background-color: #
background-image: url(SomeImage.gif);}
h3 {background-color: #ff0000;}
.blueback {background-color: #0000}
Adding another property to the same { } is allowed. Just separate them with a semi-colon and space. You can have them on the same line, or on the next line as seen in the example.
There is a url( ) area. If the image is in the same directory as the page, you can use just the image name, or you can specify the complete URL of the image.
Now add in another CLASS type to create an image background when it is used in the main BODY code area :
&style type=&text/css&&
body {background-color: #
background-image: url(SomeImage.gif)}
h3 {background-color: #ff0000;}
.blueback {background-color: #0000}
.imgback {background-image: url(SomeImage2.gif);}
Any text or objects within an HTML tag using the class=&imgback& will now have an image background behind them.
With all backgrounds, be sure to use one that will allow the text to stand out and be seen easily. Nothing is worse than getting to a site and not being able to read the text over a distracting image.
Normally, the background &tiles& the image. It repeats the specified image both horizontally and vertically. This can be controled using the background-repeat property. The values for this property are repeat-x, repeat-y, and no-repeat.
repeat-xtiles the image across left to right only.
repeat-ytiles the image top to bottom only.
no-repeatwill cancel any repeat of the image.
This example shows how to produce a left side image border using the embedded CSS.
&style type=&text/css&&
body {background-color: #
background-repeat: repeat-y;
background-image: url(SomeImage.gif)}
Or it can be shortened to :
&style type=&text/css&&
body {background-color: #
background-image: url(SomeImage.gif) repeat-y;}
Normally, a background image will start at the top left corner of the window. This may be controlled using positioning.
&style type=&text/css&&
body {background-position:}
The example above shows values that would adjust the background image to the same as it normally would.
The first position value can be set to top, center, bottom, percentage, or pixel setting.
The second position value can be set to right, center, left, percentage, or pixel setting.
Fixing (Sticky)
Normally, a background image will move along with the scrolling of a page just like any text or image does. This may be controlled in IE 4+ viewers using a fixed setting.
&style type=&text/css&&
body {background-attachment:}
This probably works in Netscape7+ as well. Any version below that doesn't support a fixed background.
The background properties can be grouped together into one command. Grouping may cause confusion in some browsers. Sometimes it's just a matter of changing the order in which the properties are listed in the command. Trial and test everything in different browsers to ensure the best results.
&style type=&text/css&&
body {background: #ffffff url(SomeImage.gif) no-r}
&& Background Style &&}

我要回帖

更多关于 background image 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信