...

View Full Version : Image won't display...



mccdaddy
07-23-2007, 05:16 AM
I'm modifying a template created in xhtml1-strict.dtd. I need to add an image and I coded it thusly: <img src="applelogo.gif" width="100" height="40" alt="Apple logo" />. The .gif is in the correct directory. From all I've read that should work but it's not. Knowing me I'm probably missing something obvious.

Thanks.

mccc

_Aerospace_Eng_
07-23-2007, 05:24 AM
File names are case sensitive. Thats about as much help as we can give as you haven't posted a url to the site.

mccdaddy
07-23-2007, 05:56 AM
All the files are in lowercase. One thing I just noticed; the image coding is within DIV tags. Would that effect it?

I'm still in the early stages and I haven't uploaded the page yet. I'll try to do that tomorrow.

Thanks.

mccd

_Aerospace_Eng_
07-23-2007, 05:59 AM
Post the rest of your html. Perhaps you just have coding errors in it causing the image not to show up.

mccdaddy
07-23-2007, 08:17 PM
Here are the HTML & the stylesheet:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Praise Travel and Transportation</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<h1>Praise Travel and Transportation</h1>
<h2></h2>
</div>
<!-- end #header -->
<div id="menu">
<ul>
<li class="first"><a href="#" accesskey="1" title="">About Us</a></li>
<li><a href="#" accesskey="2" title="">Our Services</a></li>
<li><a href="#" accesskey="3" title="">Our Products</a></li>
<li><a href="#" accesskey="4" title="">Customer Support</a></li>
<li><a href="#" accesskey="5" title="">Contact Us</a></li>
</ul>
</div>
<!-- end #menu -->
<div id="content">
<div id="posts">
<div class="post">
<h2 class="title">We are Your Vacation & Travel Resource</h2>
<div class="story">
<p><strong>Whether</strong> it's a Western Carribean cruise, a vacation at an exclusive Cancun/ Riviera Maya resort or a weekend excursion to New York, <em><strong>Praise Travel and Transportation</strong></em> is here to handle all your travel needs. </p>
</div>
</div>
<div class="post">
<h2 class="title">Associated with</h2> <img src="applelogo.gif" width="100" height="40" alt="Apple logo" /> <div class="story">
<p><strong>This</strong> is an example of a paragraph followed by a blockquote. In posuere eleifend odio. Quisque semper augue mattis wisi. Maecenas ligula. Pellentesque viverra vulputate enim. Aliquam erat volutpat lorem ipsum dolorem.</p>
<blockquote>
<p>Pellentesque tristique ante ut risus. Quisque dictum. Integer nisl risus, sagittis convallis, rutrum id, elementum congue, nibh. Suspendisse dictum porta lectus. Donec placerat odio</p>
</blockquote>
<h3>Heading Level Three</h3>
<p>An unordered list example:</p>
<ul>
<li>List item number one</li>
<li>List item number two</li>
<li>List item number three </li>
</ul>
<p>An ordered list example:</p>
<ol>
<li>List item number one</li>
<li>List item number two</li>
<li>List item number three</li>
</ol>
</div>
</div>
</div>
<!-- end #posts -->
<div id="links">
<ul>
<li>
<h2>News &amp; Updates</h2>
<ul>
<li><a href="#">February 2007</a> <i>(22)</i></li>
<li><a href="#">January 2007</a> <i>(31)</i></li>
<li><a href="#">December 2006</a> <i>(31)</i></li>
<li><a href="#">November 2006</a> <i>(30)</i></li>
<li><a href="#">October 2006</a> <i>(31)</i></li>
</ul>
</li>
<li>
<h2>Lorem Ipsum Dolor</h2>
<ul>
<li><a href="#">Donec Dictum Metus</a></li>
<li><a href="#">Etiam Rhoncus Volutpat</a></li>
<li><a href="#">Integer Gravida Nibh</a></li>
<li><a href="#">Maecenas Luctus Lectus</a></li>
<li><a href="#">Mauris Vulputate Dolor Nibh</a></li>
<li><a href="#">Nulla Luctus Eleifend</a></li>
<li><a href="#">Posuere Augue Sit Nisl</a></li>
</ul>
</li>
</ul>
</div>
<!-- end #links -->
<div style="clear: both;">&nbsp;</div>
</div>
<!-- end #content -->
<div id="footer">
<p id="legal">Copyright &copy; 2007 Praise Travel and Transportation. Designed by mccd</p>
</div>
<!-- end #footer -->
</body>
</html>




body {
margin: 0;
padding: 0;
background: #FFFFFF url(images/img01.jpg) repeat-x;
font: normal 12px Verdana, Tahoma, Arial, Helvetica, sans-serif;
color: #666666;
}

h1, h2, h3 {
margin: 0;
padding: 0;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
color: #3E44BC;
}

h2 {
text-transform: uppercase;
font-size: 18px;
}

h3 {
text-transform: uppercase;
letter-spacing: 2px;
font-size: 11px;
}

p, blockquote, ul, ol {
line-height: 18px;
text-align: justify;
}

blockquote {
padding-left: 20px;
background: url(images/img05.gif) repeat-y;
}

a {
color: #3E44BC;
}

a:hover {
text-decoration: none;
}

/* Header */

#header {
width: 760px;
height: 180px;
margin: 0 auto;
background: url(images/title_bg.jpg);
}

#header h1, #header h2 {
text-transform: lowercase;
font-weight: normal;
color: #FFFFFF;
}

#header h1 {
float: left;
padding: 120px 0 0 20px;
font-size: 36px;
}

#header h2 {
float: right;
padding: 134px 20px 0 0;
font-size: 22px;
}

/* Menu */

#menu {
width: 760px;
height: 50px;
margin: 0 auto;
}

#menu ul {
margin: 0;
padding: 0;
list-style: none;
}

#menu li {
display: inline;
}

#menu a {
display: block;
float: left;
padding: 17px 20px 0 20px;
background: url(images/img03.gif) no-repeat;
text-transform: uppercase;
text-decoration: none;
font: bold 12px "Trebuchet MS", Arial, Helvetica, sans-serif;
color: #D8D8D8;
}

#menu a:hover {
color: #FFFFFF;
}

#menu .first a {
background: none;
}

/* Content */

#content {
width: 720px;
margin: 0 auto 20px auto;
padding: 20px;
background: #FFFFFF url(images/img04.jpg) repeat-x left bottom;
}

/* Posts */

#posts {
float: left;
width: 480px;
}

/* Links */

#links {
float: right;
width: 200px;
padding-left: 20px;
background: url(images/img05.gif) repeat-y;
}

#links ul {
margin: 0;
padding: 0;
list-style: none;
}

#links li ul {
padding: 5px 0 30px 0;
}

#links li li {
padding: 7px 10px;
background: url(images/img06.gif) repeat-x left bottom;
}

#links li a {
text-decoration: none;
}

#links li a:hover {
text-decoration: underline;
}

#links li i {
font-style: normal;
font-size: 9px;
}

#links li h2 {
font-size: 14px;
}

/* Footer */

#footer {
height: 100px;
padding: 20px;
background: #2D2D2D url(images/img07.gif) repeat-x;
}

#footer p {
text-align: center;
color: #999999;
}

mccd

_Aerospace_Eng_
07-23-2007, 08:44 PM
I still think the image path is incorrect. Your code is fine.

garydarling
07-23-2007, 09:09 PM
Try inserting an absolute path to your image, e.g.: http://www.mysite.com/images/applelogo.gif

or whatever your url is, instead of just the filename.

mccdaddy
07-24-2007, 12:16 AM
I had been working with the files on my h/d and the image was in the same directory as index.html. Once I uploaded everything the .gif displayed.

Thank you all very much for your assistance.

mccd



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum