CSS Background-position Property

Reference entry on the Background-position property of CSS, including a list of possible values, and useful example.

The background-position property sets the position of the background-image.

Possible Values

  1. Units of Measurement
  2. Keywords

The keywords are:

  1. top
  2. right
  3. bottom
  4. left

Example:

In the following example, i first set the background-image for body, then background-repeat, and last the position of the image.

body {
  background-image: url("MyImage.png");
  background-repeat: no-repeat;
  background-position: 24px 48px;
}

In the above example the image is placed 24px from the top of its element, and 45px from the left side of its element.

Inherited? - NO!

Tilføj kommentar

Links som bliver tilføjet er uden rel="nofollow", men vil blive slettet hvis de bliver anset som spam.

[url=Absolutte URL til side]TITEL[/url]

Du skal bruge code tags rundt om kode eksempler, for at bevare mellemrum og linjeskift. Kode eksempler bliver kun syntax fremhævet, hvis du fortæller hvad for et sprog du bruger.

[code1 html|css|javascript|php|sql]Indsæt din kode her[/code1]

Du vil måske læse vores Privat Politik før du tilføjer en kommentar.