This entry was posted on Tuesday, July 6th, 2010 at 11:23 pm and is filed under Web Space Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


My Space Proxy
Ultimate Web Space Tools for any Skill Level
How can I get my mock web site to display in a browser?
I’m learning CSS and and trying to get it to display on my browser. I’ve not transferred the files with any FTP program or anything because I don’t have web space and I just want to see it on my local browser. The HTML changes appear (like if I change the BG Color and the Alternate Text for the IMG) but the pictures will not. I’ve included the computer address (C:\Documents and Settings\Compaq\My Documents\My Pictures\PictureName.jpg) but nothing appears. Any ideas what I’m doing wrong and how to fix it?
Here is what I have so far:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
body
{background-color:#ffffff;
background-image:url(’Images\NMNlogoxx.jpg’);
background-repeat:repeat-x;
background-attachment:fixed;
}
</style>
</head>
<body>
</body>
</html>
If you’re trying to view the site on a local computer (Assuming there is no php,python,perl,asp) then all you should need to do is set your relative paths.
Example:
Folder Layout:
/ (Root of the Website)
|_Images (Folder)
|_Includes (Folder)
|_CSS (Folder)
|_index.html (HTML/PHP/ASP Page)
So your file paths in this case for images would be <img src="Images/pretty.gif" alt="Pretty Picture" />
If you use absolute paths, it won’t work. <img src="C:\boat.gif" alt="Big Boat" />, This is because the browser really doesn’t know where C:\ is in comparison to the index.html page.
I hope this answered your question, if not please feel free to contact me at
shattered_steel_5(at)yahoo(dot)com
6 Responses to “How can I get my mock web site to display in a browser?”
Leave a Reply

July 7th, 2010 at 5:06 am
can we see your code.
References :
July 7th, 2010 at 5:45 am
u need to save your file as a .html file then u can open it with IE or firefox or whatever browser…
References :
??
July 7th, 2010 at 6:25 am
If you’re trying to view the site on a local computer (Assuming there is no php,python,perl,asp) then all you should need to do is set your relative paths.
Example:
Folder Layout:
/ (Root of the Website)
|_Images (Folder)
|_Includes (Folder)
|_CSS (Folder)
|_index.html (HTML/PHP/ASP Page)
So your file paths in this case for images would be <img src="Images/pretty.gif" alt="Pretty Picture" />
If you use absolute paths, it won’t work. <img src="C:\boat.gif" alt="Big Boat" />, This is because the browser really doesn’t know where C:\ is in comparison to the index.html page.
I hope this answered your question, if not please feel free to contact me at
shattered_steel_5(at)yahoo(dot)com
References :
Web Developer, SysAdmin, Software Developer.
July 7th, 2010 at 7:15 am
Make sure the picture links (the img tags and css image tags) are correct (as in the path you’ve shown). That’s about all you need. If the pictures show as red Xs your path is incorrect.
References :
July 7th, 2010 at 7:49 am
Make a projects folder and make a folder for all the images you will use on your web page(s). You’re problem is the wrong path coding to your images. The page needing the images must have the same relationship with each other online so make the Projects folder. This will make uploading your files easier. All paths will not have to be redone if you use relative paths to begin with.
Your path on your hard drive is wrong. If you just HAVE to use it:
file:///C:/Users/User_Name/Documents/ Projects/ imgs/ favicon.gif
Added spaces to show a long path on YA.
Ron
References :
July 7th, 2010 at 8:04 am
The others have given good advice but you could also try installing XAMPP. XAMPP is a program which creates a small server on your own machine which you can then access through http://localhost. This will allow you to see your website more or less as it would work on a real webserver.
References :
I’ve been a professional web developer and web designer for 5 years and I use XAMPP for fast prototyping and development.
http://www.apachefriends.org/en/xampp.html