0

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

2
  • 4
    Remove this line in your css file CSS Document */.Check jsbin.com/tixacemo/15/edit Commented Jul 10, 2014 at 2:17
  • Agreed. The stray bit of comment is preventing the first bit of css from parsing. Commented Jul 10, 2014 at 2:20

3 Answers 3

2

Remove

CSS Document */

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

Sign up to request clarification or add additional context in comments.

Comments

0

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 */

1 Comment

Ah I'm blind! Thanks!
0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.