Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Image not showing up in HTML

Posted by: throwaway Jan 10 2017, 06:51 PM

Hi, absolute beginner to HTML here. Trying to get a simple website up but images aren't loading. Here is the webpage for reference: http://acsweb.ucsd.edu/~gpc001/examples.html

Thank you for any help.

I've tried all of these formats for my picture (diff file names but all same picture):

<img src=“pr1.gif”>
<img src=“pracprob1.png”>
<img src=“http://acsweb.ucsd.edu/~gpc001/pracprob1.png”>
<img src=“http://acsweb.ucsd.edu/~gpc001/pracprob1.png”>
<img src="images/irTRAUW.gif">
<img src="images/irTRAUW.gif" />
<img src="../images/irTRAUW.gif" />
<img src="/images/irTRAUW.gif" />

"http://acsweb.ucsd.edu/~gpc001/pracprob1.png" (and other file paths) shows up when I enter it in the address bar but it fails when I put it in the <img....> or <a href=...> format.

Public html folder: IPB Image



Images folder: IPB Image

Posted by: throwaway Jan 10 2017, 06:53 PM

Edit:
Using Safari, Mac version 10.###

Here's the HTML code for reference (still super basic, just trying to get past this image problem before attempting anything else).

<!DOCTYPE html>

<style>
li {
display:inline;
padding: 10px;
}
</style>

<body>
<center>
<h3>Try the problem first, then click the solution.</h3>

<nav>
<ul>
<li><a href="http://acsweb.ucsd.edu/~gpc001/">Home</a></li>
<li><a href=“solutions.html">AP Calculus Exam Solutions</a></li>
<li><strong><a href="examples.html">Practice Problems</a></strong></li>
<li><a href="misc.html">Helpful Resources</a></li>
<li><a href="contact.html">Contact Mr. Calculus</a></li>
</ul>
</nav>


<table>
<tr>
<th>Problem</th>
<th>Solution</th>
</tr>
<tr>
<th>Maximum length of a ladder able to go around a corner in a hallway <br>

<style type="text/css">
/* animated spoiler CSS by Bloggersentral.com */
.spoilerbutton {display:block;margin:5px 0;}
.spoiler {overflow:hidden;background: #f5f5f5;}
.spoiler > div {-webkit-transition: all 0.2s ease;-moz-transition: margin 0.2s ease;-o-transition: all 0.2s ease;transition: margin 0.2s ease;}
.spoilerbutton[value="Show"] + .spoiler > div {margin-top:-100%;}
.spoilerbutton[value="Hide"] + .spoiler {padding:5px;}
</style>

<input class="spoilerbutton" type="button" value="Show" onclick="this.value=this.value=='Show'?'Hide':'Show';">
<div class="spoiler"><div>
<img src=“images/irTRAUW.gif”>
</div></div>

</th>
<th>Solution</th>
</tr>
</table>

<img src=“http://acsweb.ucsd.edu/~gpc001/pracprob1.png”>
</center>

</body>

Posted by: Christian J Jan 10 2017, 08:42 PM

QUOTE(throwaway @ Jan 11 2017, 12:51 AM) *

<img src=“pr1.gif”>
<img src=“pracprob1.png”>
<img src=“http://acsweb.ucsd.edu/~gpc001/pracprob1.png”>
<img src=“http://acsweb.ucsd.edu/~gpc001/pracprob1.png”>

The above uses the wrong kinds of doublequote characters. Avoid using an editor that inserts those.

CODE
<img src="images/irTRAUW.gif">
<img src="images/irTRAUW.gif" />

The above seems correct.

CODE
<img src="../images/irTRAUW.gif" />
<img src="/images/irTRAUW.gif" />

The above seems to use wrong image paths. See also http://htmlhelp.com/faq/html/basics.html#relative-url

Posted by: throwaway Jan 10 2017, 09:32 PM

Oh my god I thought the problem was with the file path all along. I spent hours trying to fix it and it ended up being the quotation marks. TextEdit was converting my quotes to the wrong ones even though it was set to Plain Text, but I've fixed it now. Thank you for noticing!

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