Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Help? Images Not Showing Up On Web Page

Posted by: thosebabyscars Jan 5 2012, 11:05 PM

None of my images work sad.gif and I'm pretty sure I have the code right because it's worked for my other projects.
Here is one of my codes:

CODE

<html>
<head>
    <link rel="stylesheet" href="style_1.css" type="text/css" />
    <script src="cursor.js" type="text/javascript"></script>

</head>

<body background="images\bg.jpg">

<h1>Goals</h1>

<img src="images\map.png" border="2" usemap="#map" align="right">
<map name="map">
<area shap="rect" coords="199,195,7,6" href="www.ufl.edu" alt="University of Florida">
<area shap="rect" coords="199,195,380,10" href="www.osu.edu" alt="Ohio State University">
<area shap="rect" coords="189,395,6,225" href="www.nd.edu" alt="University of Notre Dame">
<area shap="rect" coords="189,376,380,220" href="www.psu.edu" alt="Penn State University">
</map>

<h2>[Header]</h2>
<p>[gibberish]</p>

</body>

</html>

Is there anything wrong with my img tag?

And how about here:
CODE

h1 {
        color:black;
        font-size:35;
        font-family:century gothic }

h2 {
        color:black;
        font-size:23;
        font-family:century gothic }

p {
        text-align:justify;
        color:black;
        font-size:16;
        font-family:century gothic }

body {
        background-image: url (images\bg.jpg);
        padding-left: 20px;
        padding-right: 20px;
        padding-top: 10px;
        padding-bottom: 15px;
        scrollbar-face-color:#FBBBB9;
        scrollbar-arrow-color:#FFFFFF;
        scrollbar-track:#FFFFFF;
        scrollbar-shadow-color:#ADDFFF;
        scrollbar-highlight-color:#FFFFFF;
        scrollbar-3dlight-color:#ADDFFF;
        scrollbar-darkshadow-Color:#FFFFFF;}

table {
        text-align:left;
        color:black;
        font-size:14;
        font-family:century gothic }


I really need some help, please?

Posted by: pandy Jan 5 2012, 11:17 PM

Your slashes tilt to the wrong side. Windows paths use backslashes, URLs use forward slashes.

CODE
<body background="images\bg.jpg">

CODE
<img src="images\map.png" border="2" usemap="#map" align="right">

CODE
background-image: url (images\bg.jpg)

Posted by: dlhylton Feb 16 2012, 03:25 PM

Your image isn't showing up because you're missing a slash. It should be:

<body background="/images/bg.jpg">

You must have a slash before images.

Check out:

http://www.allthingsdiscussed.com/More/How-to-add-images-to-a-web-page

if you want to see in more detail

Posted by: pandy Feb 16 2012, 03:42 PM

No, you mustn't. The first version, without a slash in front, is a relative URL, relative to the document it's in. Your version is a root relative URL, relative to the document root.

See http://htmlhelp.com/faq/html/basics.html#relative-url .


If I want to link from http://example.com/bla/index.html to http://example.com/bla/images/dog.jpg the relative URL would be images/dog.jpg and the root relative URL /bla/images/dog.jpg .


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)