.up { background-image: url('/design-library/profound_test/images/cab_images/white-arrow-up.png') 50% 50% no-repeat; }
This code is giving me an ‘invalid property value’ in crome (and safari). I’m using the exact same code on another page, working correctly. I cleared my browser cache. If I remove 50% 50% no-repeat it works fine. Adding either of those 2 properties spikes it again to invalid (testing using developer tools).
I ran it through ProCSSor as well to clean it up, so I’m not sure where I’m screwing it up…
Hamed
1,1553 gold badges20 silver badges45 bronze badges
asked Jan 17, 2013 at 11:48
Yep because the background-image property is for the image part only, not the position or repeat properties of the background, use background:
.up {
background: url('/design-library/profound_test/images/cab_images/white-arrow-up.png') 50% 50% no-repeat;
}
answered Jan 17, 2013 at 11:50
Tom WaltersTom Walters
15k7 gold badges58 silver badges74 bronze badges
4
Chrome* will also throw this warning (and doesn’t display the bg image), if you have a blank space between url and ( like:
background-image: url ('img/web-bg.png');
^
(Which was the reason for me to search and find this question but no answer and then doing trial and error.)
- … maybe depending on the Chrome version, I assume.
answered Jun 13, 2015 at 12:35
![]()
MichaelMichael
6015 silver badges17 bronze badges
0
Even if you do everything described above, you may get an «invalid property value» in Firefox. The workaround is to convert:
background: url(../img/showcase.jpg) no-repeat top center fixed/cover;
into:
background: url(../img/showcase.jpg) no-repeat top center;
background-attachment: fixed;
background-size: cover cover;
answered May 25, 2020 at 11:21
![]()
porcupineporcupine
1011 silver badge3 bronze badges
This error also occurs in Chrome when you don’t use apostrophes and your file has spaces. Simply change:
background-image: url(../img/file with spaces.png);
to:
background-image: url('../img/file with spaces.png');
answered Oct 17, 2020 at 18:43
2
Just delete ../ and use it as
background: url(img/showcase.jpg) no-repeat top center;
NearHuscarl
55.9k13 gold badges218 silver badges197 bronze badges
answered Oct 6, 2020 at 18:20
|
ryana
http://ksaverk.ru Сообщений: 7 |
wordpress, пытаюсь вставить в хэдэр картинку, выдаёт ошибку invalid property value уже повставляла во все дивы, картинка (адрес проверяла, работает) не появляется, только цвет можно в бекграунде сделать. |
||
|
|
Mari
Пол: |
ryana, в Опере картинка вставляется. |
||
|
|
ryana
http://ksaverk.ru Сообщений: 7 |
спасибо, ширину и высоту пока не делала. Значит, проблема в браузерах — модзилле и хроме. Неужели они что-то в коде не читают? вроде совсем простой css |
||
|
|
ryana
http://ksaverk.ru Сообщений: 7 |
Спасибо, но с этого и начинала. не помогает. background: #600 url(img/bg.png) |
||
|
|
KoRNeT46RuS 1 / 1 / 1 Регистрация: 07.03.2012 Сообщений: 78 |
||||
|
1 |
||||
|
11.10.2014, 17:15. Показов 52986. Ответов 3 Метки нет (Все метки)
Такая борода (скрин вложил).
Попрошу без шуток. Я начинающий. В чем проблема? Почему не отображается? Миниатюры
__________________
0 |
|
3322 / 2842 / 1423 Регистрация: 15.01.2014 Сообщений: 6,170 |
|
|
11.10.2014, 18:12 |
2 |
|
Почему не отображается? По иерархии есть стили, которые перекрывают css-правило «background» для «.head-contact». Смотрите там же в инспекторе, где еще определяется это свойство.
0 |
|
KoRNeT46RuS 1 / 1 / 1 Регистрация: 07.03.2012 Сообщений: 78 |
||||
|
11.10.2014, 19:58 [ТС] |
3 |
|||
|
По иерархии есть стили, которые перекрывают css-правило «background» для «.head-contact». Смотрите там же в инспекторе, где еще определяется это свойство.
Вот весь код. Я найти конфликт не могу
0 |
|
3322 / 2842 / 1423 Регистрация: 15.01.2014 Сообщений: 6,170 |
|
|
11.10.2014, 20:24 |
4 |
|
Решение
Я найти конфликт не могу Мде… Можно было бы долго искать. У вас HEX-код цвета (#f8farb) не корректный. Таблица «безопасных» цветов
2 |
Chrome* will also throw this warning (and doesn’t display the bg image), if you have a blank space between url and ( like:
background-image: url ('img/web-bg.png');
^
(Which was the reason for me to search and find this question but no answer and then doing trial and error.)
- … maybe depending on the Chrome version, I assume.
This error also occurs in Chrome when you don’t use apostrophes and your file has spaces. Simply change:
background-image: url(../img/file with spaces.png);
to:
background-image: url('../img/file with spaces.png');
Yep because the background-image property is for the image part only, not the position or repeat properties of the background, use background:
.up {
background: url('/design-library/profound_test/images/cab_images/white-arrow-up.png') 50% 50% no-repeat;
}
Even if you do everything described above, you may get an «invalid property value» in Firefox. The workaround is to convert:
background: url(../img/showcase.jpg) no-repeat top center fixed/cover;
into:
background: url(../img/showcase.jpg) no-repeat top center;
background-attachment: fixed;
background-size: cover cover;
Tags:
Css
Safari
Google Chrome
Related
.up { background-image: url('/design-library/profound_test/images/cab_images/white-arrow-up.png') 50% 50% no-repeat; }
This code is giving me an ‘invalid property value’ in crome (and safari). I’m using the exact same code on another page, working correctly. I cleared my browser cache. If I remove 50% 50% no-repeat it works fine. Adding either of those 2 properties spikes it again to invalid (testing using developer tools).
I ran it through ProCSSor as well to clean it up, so I’m not sure where I’m screwing it up…
6 Answers
Yep because the background-image property is for the image part only, not the position or repeat properties of the background, use background:
.up {
background: url('/design-library/profound_test/images/cab_images/white-arrow-up.png') 50% 50% no-repeat;
}
Chrome* will also throw this warning (and doesn’t display the bg image), if you have a blank space between url and ( like:
background-image: url ('img/web-bg.png');
^
(Which was the reason for me to search and find this question but no answer and then doing trial and error.)
- … maybe depending on the Chrome version, I assume.
Even if you do everything described above, you may get an «invalid property value» in Firefox. The workaround is to convert:
background: url(../img/showcase.jpg) no-repeat top center fixed/cover;
into:
background: url(../img/showcase.jpg) no-repeat top center;
background-attachment: fixed;
background-size: cover cover;
This error also occurs in Chrome when you don’t use apostrophes and your file has spaces. Simply change:
background-image: url(../img/file with spaces.png);
to:
background-image: url('../img/file with spaces.png');
Just delete ../ and use it as
background: url(img/showcase.jpg) no-repeat top center;
Your file name must contain no white spaces.
.up { background-image: url('/design-library/profound_test/images/cab_images/white-arrow-up.png') 50% 50% no-repeat; }
This code is giving me an ‘invalid property value’ in crome (and safari). I’m using the exact same code on another page, working correctly. I cleared my browser cache. If I remove 50% 50% no-repeat it works fine. Adding either of those 2 properties spikes it again to invalid (testing using developer tools).
I ran it through ProCSSor as well to clean it up, so I’m not sure where I’m screwing it up…
Hamed
1,1553 gold badges20 silver badges45 bronze badges
asked Jan 17, 2013 at 11:48
Yep because the background-image property is for the image part only, not the position or repeat properties of the background, use background:
.up {
background: url('/design-library/profound_test/images/cab_images/white-arrow-up.png') 50% 50% no-repeat;
}
answered Jan 17, 2013 at 11:50
Tom WaltersTom Walters
15k7 gold badges58 silver badges74 bronze badges
4
Chrome* will also throw this warning (and doesn’t display the bg image), if you have a blank space between url and ( like:
background-image: url ('img/web-bg.png');
^
(Which was the reason for me to search and find this question but no answer and then doing trial and error.)
- … maybe depending on the Chrome version, I assume.
answered Jun 13, 2015 at 12:35
![]()
MichaelMichael
6015 silver badges17 bronze badges
0
Even if you do everything described above, you may get an «invalid property value» in Firefox. The workaround is to convert:
background: url(../img/showcase.jpg) no-repeat top center fixed/cover;
into:
background: url(../img/showcase.jpg) no-repeat top center;
background-attachment: fixed;
background-size: cover cover;
answered May 25, 2020 at 11:21
![]()
porcupineporcupine
1011 silver badge3 bronze badges
This error also occurs in Chrome when you don’t use apostrophes and your file has spaces. Simply change:
background-image: url(../img/file with spaces.png);
to:
background-image: url('../img/file with spaces.png');
answered Oct 17, 2020 at 18:43
2
Just delete ../ and use it as
background: url(img/showcase.jpg) no-repeat top center;
NearHuscarl
55.9k13 gold badges218 silver badges197 bronze badges
answered Oct 6, 2020 at 18:20
.up { background-image: url('/design-library/profound_test/images/cab_images/white-arrow-up.png') 50% 50% no-repeat; }
This code is giving me an ‘invalid property value’ in crome (and safari). I’m using the exact same code on another page, working correctly. I cleared my browser cache. If I remove 50% 50% no-repeat it works fine. Adding either of those 2 properties spikes it again to invalid (testing using developer tools).
I ran it through ProCSSor as well to clean it up, so I’m not sure where I’m screwing it up…
Hamed
1,1553 gold badges20 silver badges45 bronze badges
asked Jan 17, 2013 at 11:48
Yep because the background-image property is for the image part only, not the position or repeat properties of the background, use background:
.up {
background: url('/design-library/profound_test/images/cab_images/white-arrow-up.png') 50% 50% no-repeat;
}
answered Jan 17, 2013 at 11:50
Tom WaltersTom Walters
15k7 gold badges58 silver badges74 bronze badges
4
Chrome* will also throw this warning (and doesn’t display the bg image), if you have a blank space between url and ( like:
background-image: url ('img/web-bg.png');
^
(Which was the reason for me to search and find this question but no answer and then doing trial and error.)
- … maybe depending on the Chrome version, I assume.
answered Jun 13, 2015 at 12:35
![]()
MichaelMichael
6015 silver badges17 bronze badges
0
Even if you do everything described above, you may get an «invalid property value» in Firefox. The workaround is to convert:
background: url(../img/showcase.jpg) no-repeat top center fixed/cover;
into:
background: url(../img/showcase.jpg) no-repeat top center;
background-attachment: fixed;
background-size: cover cover;
answered May 25, 2020 at 11:21
![]()
porcupineporcupine
1011 silver badge3 bronze badges
This error also occurs in Chrome when you don’t use apostrophes and your file has spaces. Simply change:
background-image: url(../img/file with spaces.png);
to:
background-image: url('../img/file with spaces.png');
answered Oct 17, 2020 at 18:43
2
Just delete ../ and use it as
background: url(img/showcase.jpg) no-repeat top center;
NearHuscarl
55.9k13 gold badges218 silver badges197 bronze badges
answered Oct 6, 2020 at 18:20





Сообщение было отмечено KoRNeT46RuS как решение