CSS tutorial: a detailed explanation of the location of a background picture

time:17-04-21 forum:HTML web page, JS language and code
  http://www.jcwcn.com/article-10563-1.html

problems in learning can be posted to the forum communication!

we often find a situation when we study the styles of other web sites, in which the same picture is called in many background attributes to meet the use of various parts of the web. Open this picture and see that this picture contains a lot of small pictures, such as






These small pictures are all parts of the whole picture, put each part on one picture, instead of storing them separately, the purpose of which we all know is to reduce the number of HTTP requests and save time and bandwidth.

how to implement a picture in a different place only to show a part of it, which uses the location of the background picture we want to say today. This question believes that many people are depressed and often have friends to ask me, so today, the system says:

we know that when using the picture as the background, CSS should write this, for example, div container, also can be body, TD, P and other background, the same reason.
[code]div{background:#FFF URL (image) no-repeat fixed x y;}[/code]
the background attribute values here are: (color values, places where background images are not covered, or background colors without background images) < (here is a picture). Address) whether
no-repeat repeats: (a picture is less than a container's big hour, the default will be repeated to fill the container, no-repeat does not repeat, only at this time the rear location coordinates are useful.) Whether the
fixed background is scrolling with the container: (there are two optional values, scroll rolling, fixed non scrolling, the default is scroll)
x y background image location: (note, it is meaningful only to locate under no-repeat. This is the focus of the day.
  • 2
  • 3

prev:A woman who walks with his hand has rais... next:The first cross-country walking conferen...
post comment
Notice



approved   Chongqing version of "peach sister":...   Returnees in mountainous areas suppo...   Where is the old Ji'nan? More than 3...   A small set of fingers can adjust th...   In the mountains, after 80 years hai...
rand   A scalable layer JS with a buffering...   Html is on the page, and the backgro...   Div floating center single div box a...   JavaScript open source cross platfor...   The 9 best JavaScript development to...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com