This is not working:
But this is working:
"../assets/images/image.jpg" -This means
That relative link will only work if your page is in a subfolder in
"http://localhost/abc/def/geh/"
If the location of your page really is
"localhost/asdf/asdf/asdf/asdf/index.php"
(which seems ridiculous) to get to the assets folder relatively you would have to go all the way to the root.
'../../../../abc/deh/geh/assets/images/image.jpg;
Alternatively you could use a base tag in your head tag to make the URL in the actual src attribute more friendly.
I will make your life very very simple.
Use it in following manner
<img src="../image_store/Part2.jpg" alt="Dress Picture"/>
I suspect you didn't actually do what I told you to so here is a screenshot:
If the image opens in a new tab then you have some kind of bug or extension that's messing it up in the html. If you messed up the relative path, you'll most likely get 404 but you'll be able to see the path as absolute.
It may look like http://localhost/asdf/asdf/asdf/asdf/assets/assets/image.jpg
Either way, send a screenshot of the above operation.
In React:
import the image:
import image from '../../assets/random-image.png'
use the imported variable as a value of a src
attribute:
<img src={image} />
<img src="assets/images/image.jpg" alt="Alternative Text">
should be working.You shouldn't have put '../' at the begining of the image path.
For better understanding about relative paths vs. absolute paths, refer this link