-1

So the problem I am having is the webpage is not loading the background image Following image address does not seem to load so page background stay's pitch black and nothing can be read because of it.

Edit: Here is my full css code.

    #intro {
   position: relative;
   padding-bottom: 102px;   
   min-height: 900px;
   width: 100%;
   background: #161415
   background-image: url("http://example.com/images/38697eae8ca030cd1f8cd11d752249ef.jpg");  no-repeat center center;
   background-size: cover !important;
    -webkit-background-size: cover !important;   
}

this is what my index.html looks like.

<!DOCTYPE html>
<!--[if lt IE 8 ]><html class="no-js ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="no-js ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 8)|!(IE)]><!--><html class="no-js" lang="en"> <!--<![endif]-->
<head>

   <!--- Basic Page Needs
   ================================================== -->
   <meta charset="utf-8">
    <title>Coming soon</title>
    <meta name="description" content="">
    <meta name="author" content="">

   <!-- Mobile Specific Metas
   ================================================== -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <!-- CSS
    ================================================== -->
   <link rel="stylesheet" href="http://example.com/new/css/default.css">
    <link rel="stylesheet" href="http://example.com/new/css/layout.css">
   <link rel="stylesheet" href="http://example.com/new/css/media-queries.css">    

   <!-- Script
   ================================================== -->
    <script src="http://example.com/new/js/modernizr.js"></script>

   <!-- Favicons
    ================================================== -->
    <link rel="shortcut icon" href="example.com/new/favicon.png" >

</head>

<body>

    <div id="preloader">      
      <div id="status">
         <img src="http://example.com/new/images/preloader.gif" height="64" width="64" alt="">
      </div>
   </div>

   <!-- Intro Section
   ================================================== -->
   <section id="intro">

    <header class="row">     

            <div id="logo" >
                <a href="#" >
                 <img src="http://185.27.134.27/login_logo/ce7c43a1c5602d942c279e478e4c7823.jpg" alt="Zoon">                  
              </a>                  
            </div>

           <nav id="nav-wrap">

              <a class="menu-btn" href="#nav-wrap" title="Show navigation">Show navigation</a>
               <a class="menu-btn" href="#" title="Hide navigation">Hide navigation</a>

              <ul id="nav" class="nav">
                 <li class="current"><a href="http://example.com" target="_blank">Home</a></li>
                 <li><a href="http://example.com/whyus.php" target="_blank">About</a></li>                   
              </ul> <!-- end #nav -->

           </nav> <!-- end #nav-wrap -->            

    </header> <!-- Header End -->       

    <div  id="main" class="row">

        <div class="twelve columns">

<p>Attention if you are the website owner you are seeing this page because you have not yet uploaded or installed a website if you are having problems please contact support through your cpanel or you may login below to edit your website.</p>

            <!-- Begin MailChimp Signup Form -->
             <div id="mc_embed_signup">
             </div>
<form action="http://cpanel.example.com/login.php" method="post" name="login" >
<label for="mod_login_username">Cpanel Username:<input name="uname" id="mod_login_username" type="text" class="inputbox" alt="username" size="10" /></label>
<label for="mod_login_password">Password:<input type="password" id="mod_login_password" name="passwd" class="inputbox" size="10" alt="password" /></label>
<input type="submit" name="Submit" class="button" value="Login" />
<a href="http://cpanel.example.com/lostpassword.php">Lost your password?</a>

         </div> 

      </div> <!-- main end -->      

   </section> <!-- end intro section -->


   <!-- About Section
   ================================================== -->
   <section id="about">

      <div class="row section-header">

        <div class="twelve columns">    

            <div class="icon-wrap">
                <i class="fa fa-group"></i>
            </div>


         </div>

      </div> <!-- end section-header -->                

      <div class="row section-content">

            <div class="six columns">

          </div>

          <div class="six columns">

          </div>            

      </div> <!-- end section-content -->  

      <div class="row section-content">

            <div class="six columns">

          </div>

          <div class="six columns">

          </div>            

      </div> <!-- end section-content -->       

      <div id="call-to-action">        

           <div class="row section-ads">

              <div class="twelve columns">                      


                    <div class="action">
                </div>

               </div>

           </div> <!-- end section-ads -->                           

       </div> <!-- end call-to-action -->           

   </section> <!-- About Section End-->    


   <!-- Location Section
   ================================================== -->
    <section id="location">

        <div class="contacts">      

            <div class="row contact-details">                                

               <div class="columns">


               </div> 

               <div class="columns">


               </div>    

               <div class="columns end">


               </div>           

            </div> <!-- end contact-details -->       

        </div> <!-- end contacts -->


    </section> <!-- end location section -->

   <!-- footer
   ================================================== -->
   <footer>

      <div class="row">

         <div class="twelve columns">            

            <ul class="copyright">
               <li>&copy; Copyright 2016 Coming soon</li>

            </ul>

         </div>          

      </div>

      <div id="go-top"><a class="smoothscroll" title="Back to Top" href="#intro"><i class="icon-up-open"></i></a></div>

   </footer> <!-- Footer End-->   

   <!-- Java Script
   ================================================== -->
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
   <script>window.jQuery || document.write('<script src="http://empire-webhosting.com/new/js/jquery-1.10.2.min.js"></script>')</script>
   <script type="text/javascript" src="http://example.com/new/js/jquery-migrate-1.2.1.min.js"></script>

    <script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>
   <script src="http://example.com/new/js/gmaps.js"></script>
   <script src="http://example.com/new/js/waypoints.js"></script>
   <script src="http://example.com/new/js/jquery.countdown.js"></script>
   <script src="http://example.com/new/js/jquery.placeholder.js"></script>
   <script src="http://example.com/new/js/backstretch.js"></script>  
   <script src="http://example.com/new/js/init.js"></script>

</body>

</html>
  • are you using a CMS? – Adjit Sep 26 '16 at 20:35
  • 1
    I don't see where is the relation between the path of your img on html and the css for taht background ??? How is related ?? Seems pretty unclear – DaniP Sep 26 '16 at 20:38
  • 2
    Just FYI when you define background-image you can't include the no-repeat. either use background: url() no-repeat or add background-repeat: no-repeat – Wim Mertens Sep 26 '16 at 20:39
  • I am using a html responsive template and I am having the issue where it wont load the background image because its looking for the url as /image/ instead of http://image.com/image its loading the image from another url on my site. – coolmark1995 Sep 26 '16 at 21:41
  • 2
    See previous comment of mine about background-im age syntax. Also you'll need a semi-colon after: background: #161415 – Wim Mertens Sep 26 '16 at 22:50
  • Are you attempting to bring in the image on a secure page? You can't bring in an image with `http` if the page you are viewing is `https`. Most browsers prevent that sort of thing I believe. Check your web console and network console for errors. – Leeish Sep 26 '16 at 22:52
  • I will edit the title as its misleading the problem as it looks on this page http://metronorth.empire-webhosting.com/ the default page that loads the image is not loading from the external like so there is not background displayed. it is not over https – coolmark1995 Sep 26 '16 at 22:59

1 Answers1

0

Change your css to this, because your css is invalid (when you define background-image you can't include the no-repeat. either use background: url() no-repeat; or add background-repeat: no-repeat;):

 #intro {
   position: relative;
   padding-bottom: 102px;   
   min-height: 900px;
   width: 100%;
   background: #161415 url(http://example.com/images/38697eae8ca030cd1f8cd11d752249ef.jpg) no-repeat center center;
   background-size: cover; 

}

Also, not necessary to include the quotes in the url syntax. I prefer to leave it out. More information on this in this post: Is quoting the value of url() really necessary?

Community
  • 1
  • 1
Wim Mertens
  • 1,780
  • 3
  • 20
  • 31