Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

body background color not showing?

Tags:

html

css

I just have a simple .shtml page:

<html>
    <head>
        <meta charset='utf-8'>
        <meta content="IE=edge" http-equiv="X-UA-Compatible">
        <meta content="width=device-width, initial-scale=1" name="viewport">
        <link href="Stylesheets/main.css" rel="stylesheet">
        <link href="Stylesheets/glicons.css" rel="stylesheet">
        <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
        <title>
            Codepixl
        </title>
    </head>
    <body>
        <!--#include file="nav.html"-->
         asdsd
        <div id="Scripts">
            <script src="http://code.jquery.com/jquery-latest.js"></script> <script src="Scripts/jquery.cookie.js"></script> <script src="Scripts/jquery-ui.min.js"></script> <script src="scripts/typed.js"></script> <script src="//codepixl.net/scripts/secret.js"></script>
        </div>
    </body>
</html>

and the stylesheet:

body{
    background-color: #32CD32;
}
.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  margin-top: -115px;
  margin-left: -115px;
    z-index: 9999;
}

But the background color isn't showing up? I've tried using html,body{} and using a doctype but nothing works! What's happening?

EDIT: I removed bootstrap and it started working... Also here's the page: http://codepixl.net/indesx.shtml

EDIT:I just had to put the bootstrap before my stylesheet -_-

like image 698
ByteDuck Avatar asked Nov 08 '14 03:11

ByteDuck


People also ask

Why is my body background color not showing up CSS?

that is because you have set the background color, and then overwritten it by using the background shorthand…. either move the background-color call after the background shorthand, or add it TO the shorthand… the browser interprets your current code like this…

Why is color not showing in HTML?

Borders don't have a background, so you might have used an invalid attribute to define the color... It works normally and without showing here, I can't imagine a case where it would not work...

How do you add a background color to your body?

To set the background color in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <body> tag, with the CSS property background-color. HTML5 do not support the <body> tag bgcolor attribute, so the CSS style is used to add background color.

In which view background color will not be visible?

Background colour or effects applied to a document is not visible in Print Preview.


1 Answers

Override style from Bootstrap by adding `!important``

body{
    background-color: #32CD32 !important;
}
like image 121
Stella Hu Avatar answered Oct 05 '22 14:10

Stella Hu