If there are spaces in the folders or images, how do I solve them?

0

In case I'm learning WEB (HTML, php, Css and Javascript), and for html there is a function for images, however I came across the difficulty of sending an image if it has spaces in the name or path.

 <body>
 <img src="../../pictures/Sample Pictures/Desert.jpg" width="400" height="300">
 </body>

I know it's recommended not to use spaces for programming languages and etc, but I was wondering if there is a way to resolve this without renaming folders or files, just for the sake of knowledge, because in fact I have the habit of not using spaces . Does anyone know how to solve this, or just renaming msm?

    
asked by anonymous 13.02.2018 / 23:39

1 answer

1

You can change spaces by the corresponding ASCII code preceded by % . the code would look something like:

 <body>
     <img src="../../pictures/Sample%20Pictures/Desert.jpg" width="400" height="300">
 </body>

Only reinforcing that this is not recommendable, as you pointed out.

    
14.02.2018 / 00:01