E
E
Evgeny Ivanov2022-04-08 12:44:25
HTML
Evgeny Ivanov, 2022-04-08 12:44:25

What is the difference in path between ./image and just image?

Example:

<img src="./image.jpg"  alt="картинка"> 
<img src="image.jpg"  alt="картинка">

In my opinion, it's one and the same.
Why 2 spellings, what's the difference?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Dubrovin, 2022-04-08
@alekcena

. - path from the current file
/ path from the root file
In your case, they are the same, so there is no difference.

M
Mikhail Lyalin, 2022-04-08
@mr_jok

! impractical to keep HTML and images in the same directory
! relative paths are written through .. and allow you to refer to an element from another directory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question