html - When I set webpage background color to black(#000000) in my CSS file it appears white on web browser, why is this? -


body { background-color: #000000 text-align:center; } #main {     width: 1000;     height: 600px;     background-color: #f1c83e; } 

when set background-color black in css code why background appear white in browser?

if add semicolon @ end of background-color: #000000 background-color: #000000;, code work properly.

here fiddle of code:

https://jsfiddle.net/81rfa9bu/

body {    background-color: #000000;    text-align: center;  }    #main {    width: 1000;    height: 600px;    background-color: #f1c83e;  }
<div class="body">    <div id="main">      hi    </div>  </div>


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -