General HTML/Web Design Programming Q`s/Background image issues

Advertisement


Question
QUESTION: Helo there,

I have a web-based application in the workstation running on local host. The background-image works fine when the application runs in the workstation.
However when i open the application from other pc in the network, the background image does not work.
The image file / source is in the workstation.i tried changing the path but nothing happen. Here is the code:

<style type="text/css">
    body {
  padding-top: 40px;
  padding-bottom: 40px;
  background-image: url('http://localhost/mpkj/img/background.jpg');  
  background-size: cover;
    }
    .the-form{
      max-width: 600px;
      padding: 29px 29px 9px 29px;
      margin: 0 auto;
      background-color: #fff;
      border: 1px solid #e5e5e5;
      -webkit-border-radius: 5px;
         -moz-border-radius: 5px;
         border-radius: 5px;
      -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
         -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
         box-shadow: 0 1px 2px rgba(0,0,0,.05);
    }
  </style>

My question is :
what should i do to make sure the background image is fixed and appears when i run the application on any other pc connected to workstation network. thanks

ANSWER: Hello - I do not know all of the complexities of your website but from what I see your background image is outside of your web files.  It works locally because the image is local.

The image needs to be within the published web files.

The following should be helpful.


http://www.w3schools.com/cssref/pr_background-image.asp

W3Schools defines HTML and is the best free resource for web design.

All the best

Nancy

---------- FOLLOW-UP ----------

QUESTION: Thanks for the reply. This might help you.
Application developed using Code Igniter framework (model, View, Controller)
i m using wamp server for local host.
it is in the www/mpkj/application/view --- all the interface files in php script / html/css stored here.
my image is in www/mpkj/img/background.jpg
index.html is is application folder.

i have search almost all forum and the website given by you, but i cant figure it out. Maybe you can help on this, any other website or forum i can refer to.thanks

Answer
In looking at the URL's that  you sent they do not seem to be correct.  I am also seeing "local host" does this mean you are on a intranet and not the internet?

I will go back and refer to - the image seems to not be within the web as it is published and seems to be referenced to where it is located.

Beyond that, sorry I can't be of more help.

Nancy

General HTML/Web Design Programming Q`s

All Answers


Answers by Expert:


Ask Experts

Volunteer


Nancy Janyszeski

Expertise

I can help with basic HTML questions and web development concepts. I do not write JavaScript, but can help with the concept of using and where to find it.

Experience

Experience in the area.I am Microsoft Office User Specialist (MOUS) Master Certified and was certified as a MOUS Authorized Instructor. Instructional design and test writer for Skills Advantage LLC, http://skillsadv.com/, Test Publisher and E-learning Solutions Provider

Publications
Courseware, intro and advanced HTML

Education/Credentials
Microsoft MOUS certified, ICDL certified

Past/Present Clients
Vocational Schools

©2016 About.com. All rights reserved.