doubanduo7620
doubanduo7620
2016-02-27 19:01

CSS背景图像没有加载,似乎没有找到图像

  • css
  • php
  • html
  • jquery

I'm making a personal website and my CSS background-image doesn't seem to be working. Link to the site is http://distorts.me/new/ it seems that it doesn't find the image because it doesn't load, it is just a white area. (Sorry for the improper punctuation not very literate ) I'm using chrome.

style.css

    body {
    background-image: url("http://distorts.me/new/includes/background.png");
    color: #C0C0C0;
}

.navbar {
  margin-bottom: 0;
  border-radius: 0;
}

.row.content {height: 450px}

.sidenav {
  padding-top: 20px;
  background-color: #808080;
  height: 100%;
  font-size: 20px;
}

a {
  color: #C0C0C0;
  text-decoration: none;
}

a:hover {
    text-decoration: none;
    color: #404040;
}

footer {
  background-color: #555;
  color: white;
  padding: 15px;
}

@media screen and (max-width: 767px) {
  .sidenav {
    height: auto;
    padding: 15px;
  }
  .row.content {height:auto;} 
}

index.php

    <html lang="en">
<!-- George M. -->
<!-- 2/26/16 -->
<?php
include 'includes/head.php';
?>
<body oncontextmenu="return false" background="includes/background.png">
<header class="container-fluid text-center" style="background-color: #404040;">
    <h1>George M. - Welcome</h1>
</header>
<div class="container-fluid text-center">    
  <div class="row content">
    <div class="col-sm-2 sidenav" style="height: 183%">
      <p><a href="index-2.html">Home</a></p>
      <p><a href="/about">About Me</a></p>
      <p><a href="/services">Services</a></p>
      <p><a href="/contact">Contact</a></p>
    </div>
    <div class="col-sm-8 text-middle">
      <h1>Welcome</h1>
      <p>test</p>
      <hr> 
      <h3>Test</h3>
      <p>test</p>
    </div>
  </div>
</div>
<footer id="foot" class="container-fluid text-center">
</footer>
<script type="text/javascript">
    document.getElementById('foot').innerHTML = 
    "<p>&copy " + new Date().getFullYear() + " Distorts | George M. All rights reserved. <span style='color: #808070;'>Made by George M.</span>"
</script>
</body>
</html>

head.php

<head> 
    <title>George M | Home</title>
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="author" content="Distorts">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="style.css">
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js" type="text/javascript"></script>
</head>
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答

为你推荐

换一换