Understanding Paths in Terminals and Websites

  Рет қаралды 1,315

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

This video explains how you can write accurate paths in the Terminal as well as in your HTML, CSS, and JavaScript files so they work locally as well as on Github Pages.
Code from video: github.com/pro...
The github repo has had the path that starts with "/" fixed to work in the final version.

Пікірлер: 10
@shahinza
@shahinza Жыл бұрын
Thanks
@amircahyadi9219
@amircahyadi9219 Жыл бұрын
Thanxs sir ❤👍👍
@Mahmoud_A999
@Mahmoud_A999 Жыл бұрын
I didn't understand the /img is it referring to the root of the file or the system? I have misunderstanding to this point
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
Web Servers have a root folder that they point to. They can access anything inside that folder but not outside of it. "/" points to that root folder.
@Mahmoud_A999
@Mahmoud_A999 Жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 ok thanks
@mkm_
@mkm_ Жыл бұрын
So when loading images (or other files) inside the html, is there a convention on when to use "img/puppy.webp" or "./img/puppy.webp"? Because I'm never sure which one is more _appropriate._
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
Both are absolutely fine.
@aleksandr2245
@aleksandr2245 Жыл бұрын
In my humble opinion, it is better to use absolute paths in HTML. This way, when you deploy your frontend app or return static files using Express, users cannot break everything by specifying incorrect paths and hitting reload. For example, if a user tries to access domain/bla-bla/nothing-here, all our assets, styles, and images will still be bound to the root.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
@Aleksandr it will depend on the location of the asset. For external ones you have to use absolute. With relative paths your code can run in your dev, staging, and production environments without changing the paths even when the folder location relative to the root changes between environments
@aleksandr2245
@aleksandr2245 Жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Thank you for clarifying!
Revealing the Differences between HTML Dialogs and the Popover API
24:14
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 8 М.
Chrome Dev Tools Console Super Powers
16:44
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 7 М.
OYUNCAK MİKROFON İLE TRAFİK LAMBASINI DEĞİŞTİRDİ 😱
00:17
Melih Taşçı
Рет қаралды 11 МЛН
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 82 МЛН
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 60 МЛН
Master CSS Overflow/Text Wrapping Like A Senior Developer
20:53
Web Dev Simplified
Рет қаралды 53 М.
The secret to mastering CSS layouts
17:11
Kevin Powell
Рет қаралды 282 М.
Deep Dive into Array from method
22:05
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 2,7 М.
Let's Fix The Fatal Flaw in TypeScript's Union Types!
13:45
Typed Rocks
Рет қаралды 19 М.
Learn JavaScript With This ONE Project!
1:10:26
Tech With Tim
Рет қаралды 723 М.
Important differences between textContent and innerText
11:44
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 2,4 М.
I redesigned YOUR websites
20:44
DesignSpo
Рет қаралды 15 М.
5 simple tips to making responsive layouts the easy way
15:54
Kevin Powell
Рет қаралды 767 М.
Chrome Dev Tools Source Panel and Breakpoints
18:21
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 6 М.
OYUNCAK MİKROFON İLE TRAFİK LAMBASINI DEĞİŞTİRDİ 😱
00:17
Melih Taşçı
Рет қаралды 11 МЛН