CSS Background Chrome Position

So, I set the background-position property for the element through the class declaration. And for some reason, chrome, and I assume that all webkit browsers ignore the background-position property.

I like it so

.buttonholder {
background-position: -175px 0px;
}

and

<span class='buttonholder'>
<a href='index.php'>Home</a>
</span>

I took out a tool like firebug in chrome and for some reason the tag appears like this:

<span class='buttonholder' style='background-position: 0% 0%; '>

Although there is no specific style declaration in the element tag. Any advice would be greatly appreciated.

Edit: Apparently, people think I'm trying to use this as a way to position an element. This is not true. I am trying to place a background image.

+3
source share
6 answers

Add this:

background-position-x: -175px;
background-position-y: 0px;

: http://code.google.com/p/chromium/issues/detail?id=57963

+3

chrome, , . .

+2

, , JavaScript jquery('[element]').css('background-position'), Chrome.

, , CSS :

[element] {
  background: #becfd3 url([background image]) no-repeat 140px 60px;
}

140px 60px , . , ?

+1

-, : absolute | | | , w3c. , , , , .

0

- - . , :

background: url(http://www.domain.com/image.png) -175px 0;

, , .

0

The property is background-positionused to place only background images, and not the elements themselves. If you want to learn CSS positioning in ten steps, see http://www.barelyfitz.com/screencast/html-training/css/positioning/

Link for background-position: https://developer.mozilla.org/en/CSS/background-position (information applies to Mozilla and Webkit)

0
source

Source: https://habr.com/ru/post/1781741/


All Articles