Jose Williams
Jose Williams

Reputation: 11

How do i make the image show up on a html file with XAMPP?

I've tried

<img src = 'name.png'/>

and

<img src = 'localhost:1234/name.png'/>

and others but the image doesn't appear on the website

Upvotes: 0

Views: 2878

Answers (3)

user1465831
user1465831

Reputation:

depends where your image is located

if you have in the root folder a folder called image then you can display the image with the img tag

<img src="image/yourimagehere.jpg" alt="" >

if is in the root folder then just simply use it

<img src="yourimagehere.jpg" alt="" >

if you just need to access the image then use the anchor tag

<a href="pathToYourImage/image.png">image or whaever you want</a>

Upvotes: 1

Abdelaziz Mokhnache
Abdelaziz Mokhnache

Reputation: 4349

if you want the image to appear in your page use:

<img src="nameOfImage.jpeg" />

If you want just a link to it use (the image will not appear in the page):

<a href="nameOfImage.jpeg"></a>

if you want them both (a clickable image):

<a href="nameOfImage.jpeg"><img src="nameOfImage.jpeg" /></a>

Upvotes: 0

Quan You
Quan You

Reputation: 117

Use this instead:

<a href="nameofpage.html"><img src="nameofimg.jpg"></a>

Upvotes: 0

Related Questions