user2252219
user2252219

Reputation: 865

HTML background color not changing

I set the bg of html to a color but it seems that its not working. I've included my html and css to show the problem.

html {height:100%; background-color:#e2e2e2;}

http://jsbin.com/tixacemo/1/edit?html,css,output

Upvotes: 0

Views: 152

Answers (3)

meeming
meeming

Reputation: 88

You need RESET html elements before you do styling:

/*
=RESET :Eric Meyer Reset Reloaded
(http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/)
---------------------------------------- */
html,body,div,span,applet,object,iframe,
h1,h2,h3,h4,h5,h6,p,blockquote,pre,
a,abbr,acronym,address,big,cite,code,
del,dfn,em,font,img,ins,kbd,q,s,samp,
small,strike,strong,sub,sup,tt,var,
dl,dt,dd,ol,ul,li,
fieldset,form,label,legend,
table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
:focus{outline:0;}
body{line-height:1;color:black;background:white;}
ol,ul{list-style:none;}
table{border-collapse:separate;border-spacing:0;}
caption,th,td{text-align:left;font-weight:normal;}
blockquote:before,blockquote:after,
q:before,q:after{content:"";}
blockquote,q{quotes:"" "";}

/* html 5 Specific */
article,aside,canvas,details,div,figcaption,figure,
footer,header,hgroup,menu,nav,section,summary,
time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;}
article,aside,canvas,details,figcaption,figure,
footer,header,hgroup,menu,nav,section,summary,
time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;}
article,aside,canvas,details,figcaption,figure,
footer,header,hgroup,menu,nav,section,summary{display:block;}


/* www.aestheticallyloyal.com/public/optimize-legibility/ */
body { text-rendering: optimizeLegibility; }
/* maxvoltar.com/archive/-webkit-font-smoothing */
html { -webkit-font-smoothing: antialiased; } 

Paste style above to the top of your stylesheet or import it in HTML with<link href="reset.css" rel="stylesheet" type="text/css">
Then you will see the background color change.

Upvotes: 0

MickyScion
MickyScion

Reputation: 516

in you head of your css put like this

@charset "utf-8";


html, body{
    height:100%; background-color:#e2e2e2;z-index:999;
}

delete the CSS Document */

Upvotes: 0

BMcNamara
BMcNamara

Reputation: 41

Remove

CSS Document */

from the CSS file. This is breaking the parsing of your file. A proper comment begins with /* and ends with */

Upvotes: 2

Related Questions