Reputation: 24967
Current code is
<html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Full Page Background Image</title>
<style>
* { margin: 0; padding: 0; }
html {
background: url(./images/bg.jpg) no-repeat center center fixed !important;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
</head>
<body>
</body>
</html>
It's showing full screen background image. However, I tried to add bootstrap css, background image is gone.
<html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Full Page Background Image</title>
<link href="./bootstrap/css/bootstrap.css" rel="stylesheet">
<script src="./js/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
<style>
* { margin: 0; padding: 0; }
html {
background: url(./images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover ;
-moz-background-size: cover ;
-o-background-size: cover ;
background-size: cover;
}
</style>
</head>
<body>
</body>
</html>
I would like to know why and how can I fix that ?
Upvotes: 0
Views: 43
Reputation: 53
Use body
not html
for CSS
<html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Full Page Background Image</title>
<link href="./bootstrap/css/bootstrap.css" rel="stylesheet">
<script src="./js/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
<style>
* { margin: 0; padding: 0; }
body {
background: url(./images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover ;
-moz-background-size: cover ;
-o-background-size: cover ;
background-size: cover;
}
</style>
</head>
<body>
</body>
</html>
Upvotes: 2