Invalid property value css ошибка

.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's user avatar

Hamed

1,1653 gold badges20 silver badges45 bronze badges

asked Jan 17, 2013 at 11:48

Mike Earley's user avatar

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 Walters's user avatar

Tom WaltersTom Walters

15.2k7 gold badges56 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

Michael's user avatar

MichaelMichael

6115 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

porcupine's user avatar

porcupineporcupine

1212 silver badges3 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

aidangoodman7's user avatar

2

Just delete ../ and use it as

background: url(img/showcase.jpg) no-repeat top center;

NearHuscarl's user avatar

NearHuscarl

63.3k16 gold badges249 silver badges222 bronze badges

answered Oct 6, 2020 at 18:20

user14402845's user avatar

We got the same problem in Chrome («Invalid property value», image not rendered) because the file name contained parentheses

background: url(img/showcase(1).jpg)

Removing the parentheses just solved the problem. Just in case that you arrive here like me due to the question’s title :-)

Chrome Version 111.0.5563.64

answered Mar 15 at 13:42

RubioRic's user avatar

RubioRicRubioRic

2,4464 gold badges27 silver badges35 bronze badges

I don’t understand what’s wrong with this? I’m watching a tutorial and it seems to work fine on the video but both mozilla and chrome ignore this code and marks it as an invalid property value.

.btn {
    background-color: #4FB69F url("img/texture.png") no-repeat right top;
} 

asked Apr 27, 2013 at 4:20

Manuel Medina's user avatar

1

change

background-color:

to

background:

Because background is a shorthand property for

  • background-color
  • background-image
  • background-position
  • background-repeat
  • background-attachment

AhsenBaig's user avatar

answered Apr 27, 2013 at 4:22

Dipesh Parmar's user avatar

Dipesh ParmarDipesh Parmar

27k8 gold badges60 silver badges90 bronze badges

2

If you are using inverted commas in your CSS, please remove them from your CSS file.

For example, find difference between each CSS rule set for .row:

.row {
     margin-left:'-16px !important';
    margin-right:'0px !important';
}
.row {
    margin-left:-16px !important;
    margin-right:0px !important;
}

BSMP's user avatar

BSMP

4,5688 gold badges33 silver badges44 bronze badges

answered Oct 14, 2020 at 10:06

Ayush Banga's user avatar

Ayush BangaAyush Banga

2694 silver badges4 bronze badges

1

Not directly a solution but a typo in CSS property value caused similar issue for me:

.PokeCard {
border: 2px solic mediumseagreen;
}

The problem was a typo solic instead of solid.

enter image description here

answered Dec 16, 2019 at 15:46

Illegal Argument's user avatar

Illegal ArgumentIllegal Argument

10.1k2 gold badges43 silver badges60 bronze badges

I had similar problem .

I tried to apply background but there was a typo.

what i tried in CSS

body{
  background:"#cebbc9"
  }

and I got this error

the error I got

simply remove the double quotes from the value. as the hex value in css is not in double quotes.

body{
  background:#cebbc9
  }

answered Jan 20, 2021 at 12:44

AyushPayasi's user avatar

1

background-color: #4FB69F; 
background-image: url('images/texture.png'); 
background-repeat: no-repeat; 
background-position: right top;

Within the image url requires not «
Background position is separate from no repeat
and ; between each element control

Sparrow's user avatar

Sparrow

2,5381 gold badge24 silver badges28 bronze badges

answered Dec 25, 2016 at 20:26

user7340463's user avatar

Instead of writing:

.btn {
  background-color: #ffffff;
  background-image: url("img_tree.png");
  background-repeat: no-repeat;
  background-position: right top;
}

You can use the shorthand property background:

.btn {
  background: #ffffff url("img_tree.png") no-repeat right top;
}

It does not matter if one of the property values is missing, as long as the other ones are in this order.
know more

answered Jun 15, 2021 at 7:47

Santosh Kumar's user avatar

В общем все написано правильно вроде как, но не отрабатывает, а через tool возле заданного стиля animation желтый треугольник и надпись invalid property value. как это можно исправить

КОД:

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="style.css">
    <title>Document</title>
</head>
<body>
    
        <div class="wave">
            <div class="wave__one"></div>
            <div class="wave__two"></div>
        </div>

</body>
</html>

CSS:

body{
	padding:0;
	margin:0;
	background-color: #555;
}

.wave{
	width:100%;
	overflow: hidden;
	position:relative;
}

.wave__one {
		background:url("img/wave/wave_top.png") repeat-x;
		width:7000px;
		height: 218px;
		animation: waves 15s infinite lianer;
		position:absolute;
		top:0;
	}

.wave__two {
		background:url("img/wave/wave_top_opacity.png") repeat-x;
		width:7000px;
		height: 218px;
		animation: waves 10s infinite lianer;
		position:relative;
		top:0;
	}

@keyframes waves {
	0% {
		margin-left: 0;
	}
	100% {
		margin-left: -1938px;
	}
}

ryana

http://ksaverk.ru
Offline Offline

Сообщений: 7

Просмотр профиля
WWW


wordpress,
сайт http://нп-цспб

пытаюсь вставить в хэдэр картинку, выдаёт ошибку     invalid property value

уже повставляла во все дивы, картинка (адрес проверяла, работает) не появляется, только цвет можно в бекграунде сделать.
адрес картинки:
http://нп-цспб.рф/wp-content/themes/redpepper/img/Fireman.jpg


Записан

Mari

Offline Offline

Пол: Женский
Сообщений: 86

Просмотр профиля


ryana, в Опере картинка вставляется.
style.css: 53
#header
background: url(«http://нп-цспб.рф/wp-content/themes/redpepper/img/Fireman.jpg») no-repeat transparent;
Единственное, у Вас ширина картинки 700, а хэдэр width: 780px и высота не прописана.


Записан
ryana

http://ksaverk.ru
Offline Offline

Сообщений: 7

Просмотр профиля
WWW


спасибо, ширину и высоту пока не делала. Значит, проблема в браузерах — модзилле и хроме. Неужели они что-то в коде не читают? вроде совсем простой css


Записан

ryana

http://ksaverk.ru
Offline Offline

Сообщений: 7

Просмотр профиля
WWW


Спасибо, но с этого и начинала. не помогает.
в остальном сайте работают отлично записи типа

background: #600 url(img/bg.png)


Записан

KoRNeT46RuS

1 / 1 / 1

Регистрация: 07.03.2012

Сообщений: 78

1

11.10.2014, 17:15. Показов 54864. Ответов 3

Метки нет (Все метки)


Студворк — интернет-сервис помощи студентам

Такая борода (скрин вложил).

CSS
1
2
3
4
5
6
7
8
9
.head-contact{
    float: right;
    background: #f8farb url('images/phone-image.jpg') right top no-repeat;
    border: 2px solid #edf2f6;
    border-radius: 0 0 10px 10px;
    text-align: right;
    margin: 0 6px 0 0;
    padding:  5px 10px;
}

Попрошу без шуток. Я начинающий. В чем проблема? Почему не отображается?

Миниатюры

Invalid property value
 



0



3322 / 2842 / 1423

Регистрация: 15.01.2014

Сообщений: 6,170

11.10.2014, 18:12

2

Цитата
Сообщение от KoRNeT46RuS
Посмотреть сообщение

Почему не отображается?

По иерархии есть стили, которые перекрывают css-правило «background» для «.head-contact». Смотрите там же в инспекторе, где еще определяется это свойство.



0



KoRNeT46RuS

1 / 1 / 1

Регистрация: 07.03.2012

Сообщений: 78

11.10.2014, 19:58

 [ТС]

3

Цитата
Сообщение от Lazy_Den
Посмотреть сообщение

По иерархии есть стили, которые перекрывают css-правило «background» для «.head-contact». Смотрите там же в инспекторе, где еще определяется это свойство.

CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
*{
    margin: 0;
    padding: 0;
}
img{
    border: none;
}
body{
    background: #f2f2f2;
}
.main{
    background: #fff;
    min-width: 980px;
    max-width: 1200px;
    margin: 0 auto;
}
    /*Шапка сайта*/
    .header{
        overflow: hidden;
    }
    .logo, slogan{
        float: left;
    }
    .logo{
        margin: 8px 0 0 30px;
    }
    .slogan{
        margin: 40px 0 30px 30px;
    }
    .head-contact{
        float: right;
        background: #f8farb url('images/phone-image.jpg') 250px 8px no-repeat;
        border: 2px solid #edf2f6;
        border-radius: 0 0 10px 10px;
        text-align: right;
        margin: 0 6px 0 0;
        padding:  5px 65px 5px 15px;
    }

Вот весь код. Я найти конфликт не могу



0



3322 / 2842 / 1423

Регистрация: 15.01.2014

Сообщений: 6,170

11.10.2014, 20:24

4

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

Решение

Цитата
Сообщение от KoRNeT46RuS
Посмотреть сообщение

Я найти конфликт не могу

Мде… Можно было бы долго искать. У вас HEX-код цвета (#f8farb) не корректный. Таблица «безопасных» цветов



2



Понравилась статья? Поделить с друзьями:
  • Invalid or unqualified reference vba ошибка
  • Invalid or corrupt jar ошибка
  • Invalid opcode 0xffff at ошибка
  • Invalid normal index 3ds max ошибка
  • Invalid next control variable reference ошибка vba