The reason for this issue is that you are overwriting the background-position
property with the background
shorthand.
Explanation :
The background declaration comprises:
the combination of default values from its individual properties:
background-image: none
background-position: 0%
0%
background-size: auto auto
background-repeat: repeat
background-origin: padding-box
background-style: a shorthand that concatenates its own detailed settings
background-clip: border-box
background-color:
transparent
(source : mdn background)
When you use background: orange
(after setting background-position
in your CSS), it automatically sets background-position: 0% 0%;
, thereby overriding your explicit background-position declaration.
Solution :
To prevent this, either place the background-position
property after the background
shorthand to avoid interference:
.service-title {
font-size: 24px;
line-height: 1.1em;
padding: 1em;
background:orange;
background-position: right top;
background-image:url('http://vectorlogo.biz/wp-content/uploads/2013/01/GOOGLE-VECTORLOGO-BIZ-128x128.png');
background-repeat:no-repeat;
}
<h1 class="service-title bg-orange icon-logo-clipped"><a href="/">test</a></h1>
Or alternatively, specify background-color
instead of using the background
shorthand to preserve the background-position directive.
.service-title {
font-size: 24px;
line-height: 1.1em;
padding: 1em;
background-position: right top;
background-color:orange;
background-image:url('http://vectorlogo.biz/wp-content/uploads/2013/01/GOOGLE-VECTORLOGO-BIZ-128x128.png');
background-repeat:no-repeat;
}
<h1 class="service-title bg-orange icon-logo-clipped"><a href="/">test</a></h1>