nurasaki
nurasaki

Reputation: 109

Why background-color: '#ff0000'; is an "invalid property value"?

I don't understand why background-color: '#ff0000'; is an "invalid property value".

HTML

<div id="aside">
  <div id="buttons-panel" class="control-panel">
      ...
  </div>
  <div id="client-panel" class="control-panel">
      ...      
  </div>
</div>

strong text CSS

#aside {

  background-color: '#ff0000';
  width: 25%;
  height: 75%;
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 10;
}

Google tools

enter image description here

Everything looks fine except the background-color, I can't see whats wrong. Thanks

Upvotes: 1

Views: 4490

Answers (5)

Mitul
Mitul

Reputation: 3427

It should be without '

#aside {
  background-color: #ff0000;
  width: 25%;
  height: 75%;
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 10;
}

Upvotes: 1

Ram kumar
Ram kumar

Reputation: 3162

Why did you use quote in hex code.. Just remove it #ff0000 like this

Upvotes: 1

Mike Sav
Mike Sav

Reputation: 15291

Have you tried removing the quotes, the background-color value is not a string:

#aside {
  background-color: #ff0000;
  width: 25%;
  height: 75%;
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 10;
}

Upvotes: 1

jbehrens94
jbehrens94

Reputation: 2406

You should use the hex colour without quotes, such as: background-color: #ff0000;.

Upvotes: 2

Carlo
Carlo

Reputation: 2112

The hex value doesn't need to be a string:

#aside {
  background-color: #ff0000;
  ...
}

Upvotes: 6

Related Questions