IMO this was why the early web was so powerful as a way to on-ramp new developers. I learned coding a little bit before the web, from school materials like writing Pascal programs in DOS, in early 90s. Those were fun little exercises for school, but that was about it. In the late 90s I got the internet and got curious about making web pages, did View Source everywhere and taught myself HTML and basic CSS/JS (nothing more advanced than alert boxes and such at the time) while in high school, and it was what really got me to start my career in software engineering.
Building a web site gives you all the "why"s. It gave you a motivation to learn different aspects of coding. Whether it's the presentation layer in HTML, or application logic in PHP and Javascript. Conditions, loops, arrays and even data structures all make sense when you have all the context of the thing you're trying to build.