dweeman
dweeman

Reputation: 89

Background Colour not showing

I am having trouble changing the background colour of my website in CSS.

body  {background-color: #c7daf9‬;}

That is currently at the top of my CSS file which is working. When I inspect element on chrome, it shows that value is not being used, as it is crossed out on the side where it shows the css.

I can't seem to understand why this would be.

You can see a demo at www.dweeman.com/eb/sitetemplate.html

There is one other section which is giving values to my body, but even when I put the bg colour in there it doesn't work.

Upvotes: 2

Views: 502

Answers (2)

ramshinde1992
ramshinde1992

Reputation: 136

I think it should't matter specifying your color code in Lowercase, but changing it to Uppercase worked for me. so you can try and update your hex color code to Uppercase.

<div class="with-lowercase"><p>dfd</p></div>
<div class="with-uppercase"><p>dfd</p></div>
.with-lowercase{
    background-color:#c7daf9‬;
}
.with-uppercase{
    background-color:#C7DAF9;
}

http://jsfiddle.net/ramshinde/8Tj6H/4/

Upvotes: 0

Daniel Rippstein
Daniel Rippstein

Reputation: 567

There is an illegal invisible character in that CSS line, right between the 9 and the semicolon.

It seems to be the Unicode Character 'POP DIRECTIONAL FORMATTING' (U+202C), which you can read more about here.

To see it in action, paste your code into a text editor, click next to the A (so it has a blinking "I" cursor), and start pressing the right arrow key. You'll notice that right after the 9, it takes two right arrows presses to reach the semicolon.

The solution: Just backspace the color entry and type it out again.

Upvotes: 4

Related Questions