HTML & CSS for Beginners Part 7: File Structure
Skills:
HTML & CSS90%
Key Takeaways
The video covers the importance of keeping files organized when creating websites, and demonstrates how to structure folders and files, including creating separate folders for images, CSS, and JavaScript, and how to update links to reflect the new file structure.
Full Transcript
keeping our files organized is super important when it comes to creating websites so let's take a look at how we should do it [Music] if you've been following along you know that our websites need a folder to live in and which we call the root directory and this is where everything is living right now so let's open that up so I have my three files there and there you know they're just floating around a little bit we need to organize our files better when we're doing a website keeping our files really well organized is very very important and it's gonna make your lives much easier especially as you carry on in his adventure web design and things just get more and more complicated so the first thing I'm going to recommend is making a folder for your images I usually just call mine IMG you'll see a lot of people doing that if you want to call it images instead you can call it images and I'm gonna put my hamster in there I have my index here and my page two there are just going to stay there in general my HTML files are just gonna all live with each other in the main part of my directory here and this subdirectory of my images another subdirectory that pretty much all your pages are going to have is a CSS so I'm gonna make a CSS folder right there so I have my images folder I have my new CSS folder and we have nothing in the CSS folder yet but starting in the next video we're gonna start playing with CSS a little bit so very soon that folder will start getting used and another folder that you'll probably start using at one point or another is a JavaScript folder so JavaScript or what you'll see most of the time is just a j/s we won't really be getting in any javascript anytime soon but it's possible you see that folder now there's a reason that I'm keeping all these file names nice and short for my folders here I'm not writing out images I'm not writing out JavaScript and it's because I have to write links to all the things I'm linking to and the shorter the link the easier it's going to be so you know I'm lazy I'm just keeping it as short as possible for myself another thing you'll notice is I'm sticking with lower case on everything it's important we keep the lower case a it's just going to make it easier because we're standardizing everything and that just makes our life easier in general the other reason this is important is especially with our HTML files and our file names such as hamster dot jpg we don't want to put in weird things we don't want to cause any problems and it's possible that if you give your files weird names that you run into problems I mentioned that we have to have an index.html for the home page and it has to be a lower case index this is important I've had people put an upper case I when we're in class and it just doesn't work so when it's on the internet it's gonna work fine here but as soon as you upload this to the Internet it's not gonna be your home page the other thing is we want to avoid spaces so there's a reason I didn't call this page two with a space in the middle I put it as one word if you really really want to have spaces put a - instead spaces create these really weird things in your document so just to show you actually let's put my space and let's open up that file and let's go look here and we can see page two and there's this weird percentage 20 and that's the symbol for the space you can even see that popping up everywhere here and when this is on a server it could cause some problems so it's gonna work while it's on my computer but I don't necessarily want to trust that working properly when I've uploaded it to the Internet and even if it does people will look up here for reference to where they are sometimes and that's just really strange you wouldn't want that as a link to your website having a page - in there like that so we avoid spaces we avoid capitals we avoid numbers we avoid anything that's just not regular text keep filenames short because it makes your life much easier and keep them descriptive page twos not really the best it worked for this because it was just a an example file my home page will always be indexed if I have an about page it will be a boat dot HTML if I have a contact page it's contact HTML I have the picture of my hamster it's hamster jpg I'm gonna have a CSS file to me style dot CSS we keep it as simple and basic as possible pretty much so you don't want to overthink things that's it for this video it's not very complicated but it's important that we keep all of our things in the right place oh actually one more thing that I forgot if I go back to my index.html now you'll see that my hamster is no longer working and because my hamster is no longer working you can see that it actually says an adorable hamster in there because I used my alt text properly so that's pretty cool as I mentioned if an image doesn't load that will happen and you'll also miss this picture changed it's because of the source I used it sort of an image generation service but we won't get into that what we will do is fixing this right here just really fast since we're here so I'm going to do an open with Adam and we can come down here so there's my first picture that's the one at the top and here's my hamster and my hamster doesn't live in this place anymore remember this is a relative link so the way this used to be working was it was in this index file and then it was trying to find hamster dot jpg and hamster dot jpg was right here so I was looking what what around here is called hamster jpg there it is and it was working there's no more hamster jpg here I have to tell it where to find this file so my image is in my image folder so I'm gonna add IMG forward slash so now it's going okay I'm gonna look for IMG oh there's something called IMG let's go inside there and inside there I'm going to look for hamster jpg and now that's working so if I save my HTML file I refresh over here now you can see that my hamster is working properly so that's it for this video if you have any questions or any comments leave them down below like the video if you liked it I'm really looking forward to the next video we're gonna start doing some CSS the page is gonna start looking good we're gonna add some colors and cool stuff to it so I look forward to seeing you there you
Original Description
A quick look at how to organize the files of your website, and fixing any links that might break when you move things around.
This video is part of a large series introducing HTML & CSS to people who have never used it before. The goal of this series is to give you a good enough understanding of HTML and CSS to let you build your first website on your own!
----
Half Bit by Kevin MacLeod is licensed under a Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/)
Source: http://incompetech.com/music/royalty-free/?keywords=%22half+bit%22
Artist: http://incompetech.com/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Kevin Powell · Kevin Powell · 4 of 60
1
2
3
▶
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
How to create an awesome navigation bar with HTML & CSS
Kevin Powell
Improve your CSS by Keepin' it DRY
Kevin Powell
HTML & CSS for Beginners Part 6: Images
Kevin Powell
HTML & CSS for Beginners Part 7: File Structure
Kevin Powell
HTML & CSS for Beginners Part 4: Bold and Italic text and HTML comments
Kevin Powell
HTML & CSS for Beginners Part 5: Links
Kevin Powell
HTML & CSS for Beginners Part 3: Paragraphs and Headings
Kevin Powell
HTML and CSS for Beginners Part 1: Introduction to HTML
Kevin Powell
HTML and CSS for Beginners Part 2: Building your first web page!
Kevin Powell
HTML & CSS for Beginner Part 8: Introduction to CSS
Kevin Powell
HTML & CSS for Beginners Part 9: External CSS
Kevin Powell
HTML & CSS for Beginners Part 10: Divs & Spans
Kevin Powell
HTML & CSS for Beginners Part 11: Classes & IDs
Kevin Powell
HTML & CSS for Beginners Part 12: The CSS Box Model - Margin, Borders & Padding explained
Kevin Powell
HTML & CSS for Beginners Part 13: Background Images
Kevin Powell
HTML & CSS for Beginners Part 14: Style Text with CSS
Kevin Powell
HTML & CSS for Beginners Part 15: How to style links
Kevin Powell
HTML & CSS for Beginners Part 16: CSS selectors and Specificity
Kevin Powell
HTML & CSS for Beginners Part 17: How to Create and Style HTML Lists
Kevin Powell
HTML & CSS for Beginners Part 18: How Floats and Clears work
Kevin Powell
HTML & CSS for Beginners Part 19: Colors with CSS - hex, rgba, and hsla
Kevin Powell
HTML & CSS for Beginners Part 20: How to center a div
Kevin Powell
HTML & CSS for Beginners Part 21: How to create a basic website layout - the HTML
Kevin Powell
HTML & CSS for Beginners Part 22: How to create a basic layout - the CSS
Kevin Powell
How to Create a Responsive Website from Scratch - Part 1: The HTML #Responsive #HTML5
Kevin Powell
How to Create a Responsive Website from Scratch - Part 2: The Header and Hero area #Responsive #CSS3
Kevin Powell
How to Create a Responsive Website from Scratch - Part 3: The About Section #Responsive #CSS
Kevin Powell
How to Create a Responsive Website from Scratch - Part 4: Building a Responsive Portfolio Section
Kevin Powell
How to Create a Responsive Website from Scratch - Part 5: Call To Action and Footer #CSS #Responsive
Kevin Powell
Tutorial: Learn how to use CSS Media Queries in less than 5 minutes
Kevin Powell
End of the year upate and what's coming to my channel to start the new year
Kevin Powell
Create a CSS only Mega Dropdown Menu
Kevin Powell
CSS Tutorial: Outline and Outline Offset
Kevin Powell
CSS Blending Modes
Kevin Powell
Parallax effect | 2 different ways to add it with jQuery
Kevin Powell
CSS Units: vh, vw, vmin, vmax #css #responsive #design
Kevin Powell
How to Create a Website - Complete workflow | Part 01: Intro + Setting things up
Kevin Powell
100 Subscribers speed coding bonus video
Kevin Powell
How to Create a Website - Complete workflow | Part 02: The Markup #HTML
Kevin Powell
How to Create a Website - Complete workflow | Part 03: Sass Variables and a Mixin #Sass
Kevin Powell
How to Create a Website - Complete workflow | Part 04: Setting up the hero and header
Kevin Powell
How to Create a Website - Complete workflow | Part 05: Typography & Buttons
Kevin Powell
How to Create a Website - Complete workflow | Part 06.1: Building the navigation with Flexbox
Kevin Powell
How to Create a Website - Complete workflow | Part 06.2: Making the nav work with jQuery
Kevin Powell
Redesigning & Coding My Website #CreateICG
Kevin Powell
How to Create a Website - Complete workflow | Part 07: Starting the flexbox grid
Kevin Powell
How to Create a Website - Complete workflow | Part 08: Promo & Problem shooting!
Kevin Powell
How to Create a Website - Complete workflow | Part 09: The CTA and Footer
Kevin Powell
How to Create a Website - Complete workflow | Part 10: Making it responsive
Kevin Powell
How to Create a Website - Complete workflow | Part 11: Making it responsive con't
Kevin Powell
How to Create a Website - Complete workflow | Part 12: Putting the site online
Kevin Powell
Create a Custom Grid System with CSS Calc() and Sass
Kevin Powell
CSS em and rem explained #CSS #responsive
Kevin Powell
Should you use Bootstrap?
Kevin Powell
How to add Smooth Scrolling to your one page website with jQuery
Kevin Powell
Let's learn Bootstrap 4
Kevin Powell
How I approach designing a website - my thought process
Kevin Powell
Build a website with Bootstrap 4 - Part 1: The setup
Kevin Powell
Build a website with Bootstrap 4 - Introduction
Kevin Powell
Build a website with Bootstrap 4 - Part 2: Customizing Variables
Kevin Powell
More on: HTML & CSS
View skill →Related Reads
📰
📰
📰
📰
Part 7B — Section 2 — React Event Handling Explained: Forms, Event Object & User Input.
Medium · JavaScript
Stop Using window.resize for Everything: A Practical Guide to the ResizeObserver API
Medium · JavaScript
Rendering Lists and Handling Events
Dev.to · Silas
React Explained: JSX, Components, Virtual DOM & Diffing Algorithm
Dev.to · Saravanan Lakshmanan
🎓
Tutor Explanation
DeepCamp AI