?
Solved

How do I compose a HTML link tag that links to an image file in a subdirectory of the current directory?

Posted on 2013-06-03
17
Medium Priority
?
283 Views
Last Modified: 2013-06-10
How do I compose a HTML link tag that links to an image file in a subdirectory of the current directory?
0
Comment
Question by:Ted Palmer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
  • 3
  • +1
17 Comments
 
LVL 23

Expert Comment

by:tailoreddigital
ID: 39217963
<img src="subdirectory/image.jpg" />
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39217979
<a href="subdirectory/image.jpg">Link to image</a>
0
 

Author Comment

by:Ted Palmer
ID: 39218004
Sorry guys. Since I am not an HTML guy, I don't know how to articulate my question very well. This image is actually a big enough picture to consume a whole web page. It should open in a separate browser tab or instance. I prefer tab. It is way to big to be imbedded in the middle of a paragraph of text. Could you modify your comment to make it open in a different browser page?

Thank you,
Ted
0
7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

 
LVL 23

Expert Comment

by:tailoreddigital
ID: 39218005
By default a browser will open a JPG, in it's own tab (all by itself).
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39218011
<a href="subdirectory/image.jpg" target="_blank">Link to image</a
0
 

Author Comment

by:Ted Palmer
ID: 39218018
tailoreddigital,

I pasted your tag into my HTML file. It causes a square nested inside of a square with an 'X' inside of it to appear in my web browser displayed HTML. When I click on it nothing happens.

I'll paste in a relevant snippent of my HTML

you have to have the Data Object Relationships diagram (<img src="0000_SubrogationDataRelationships.tif"/> ) in front of you whenever you are trying

Thanks,
Ted Palmer
0
 

Author Comment

by:Ted Palmer
ID: 39218023
padas:

Are you sure this is right?

<a href="subdirectory/image.jpg" target="_blank">Link to image</a

The '</a' on the end looks like a syntax error.

Ted Palmer
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39218038
It's a copy and paste error.  Like paying the rent....you must close the tag.  </a>
0
 

Author Comment

by:Ted Palmer
ID: 39218039
So can I copy and paste your code into my HTML and modify it to display my image file and expect it to work?
0
 
LVL 23

Expert Comment

by:tailoreddigital
ID: 39218050
Padas code should work.   When i posted to you i was trying to show you how to use a sub folder,  i assumed you knew how to load from the current folder.    Padas code is the complete tag.
0
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 total points
ID: 39218052
If you want to have a link called "Link to image" that will open up a jpg file in a new tab/window then yes, this is the code.  

<a href="subdirectory/image.jpg" target="_blank">Link to image</a>
0
 

Author Comment

by:Ted Palmer
ID: 39218075
Padas,

I pasted your code into my HTML file. It looks like this:

you have to have the Data Object Relationships diagram (<a href="0000_SubrogationDataRelationships.tif" target="_blank">SubrogationDataRelationships</a> ) in front of you whenever you

The web page displays the anchor text as "SubrogationDataRelationships".

The path to the file is "C:\Drv3\Temp\Temp-9"


See attached file for the error-message.png file

I left out the subdirectory.
CanNotFind.png
0
 

Author Comment

by:Ted Palmer
ID: 39218087
Padas,

Ok! when I did like I asked you to show me to make it, it worked. It opened the image file in the program that is in the windows registry to use to open that kind of file. It work the way I asked how to make it work,

You got it. Thank you.

Ted Palmer
0
 

Author Closing Comment

by:Ted Palmer
ID: 39218090
Thank you. You do good work.

Ted Palmer
0
 
LVL 10

Expert Comment

by:Ishaan Rawat
ID: 39218092
Firstly you have to add an alt attribute to the img as said by the W3c...

The correct format of the img tag is..

<img src="path_of_image.image_format" alt="alternate_text">

Open in new window


and your code would be somewhat like this...

<a href="path_of_the_image">Click here to see the image</a>

Open in new window

0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39218106
Thanks!  I'm glad it worked.
0
 

Author Comment

by:Ted Palmer
ID: 39236767
I thought I was posting this comment in a different question sorry. So I extracted it out of here.

Ted Palmer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question