Creating Our Index Style Pages
Alright. We're onto project number one. So project zero is finished. That was our like getting used to things and just learning the basics. Now we're going to actually start making some stuff. So we're going to build a structure. Okay. That's our project one structure I've written at the top there. We're gonna make some basic kind of div tag structure to it. Then we'll add some details to it. These are my wife frames, we'll add a logo and some headings and some buttons and some maps and cool stuff and eventually hopefully it'll look like this. This will be our final kind of looking thing. I know exactly. It'll look exactly like that because I've already made it. But first of all, in this video, we need to work out how to create an index dot html page and how to connect our CSS together will also show you how to kind of separate the documents like this side by side. All right, you ready? Project one about to begin. Okay. So it's time for our new site. So let's clean things up and get ou...
r new site started. So let's close down everything in ves codes got nothing open. And we've been working in a folder called Project Zero. We're up to Project 10 was like a throwaway projects. Okay. So those are things that we just used to test understand what a few of the basic things we've had to learn so far. So what we need to do is create a new local folder. So we call it the local folder because it's on your computer, not on the internet, it's local local to you at least. So we need to create a new folder and create our html and CSS give them names and link them together. So first up let's go to file and we're gonna create a new folder Now. It doesn't matter if you if you find it a little bit difficult to go because we had to go to open a folder and then create a new folder. It's kind of weird. You can do it through your operating system. So if you're on Windows it's different but on a mac person finder, go to your desktop. Okay. And then here I can right click and say new folder. It doesn't really matter how you get this new folder. Okay. But we need a project one on a pc. It's very similar. Open up your my documents, find your desktop and right click make a new folder. So either way we want to have a new folder and open it And on my desktop or is he there? There's my new folder. Project. one click open. Nothing really happens. It's kind of flashes and you get the welcome screen back again. I remember when I first started using PS code and I was like, oh man, it's confusing. So get rid of that. Let's make a new document file, new file. We're going to create two of them will create an html file save now this html document. We've given it random names so far like div tags dot html or hello world dot html. Now for a website you need at least one page or at least one page. You need your homepage to be called this exact thing. Okay. Said it needs to be called index dot html. If you called it homepage dot html, put it up on the internet at the browser would go to your site dans awesome website dot com and go looking for index and couldn't find it. And we'll load up a big error on your page. So you need at least one page called index dot html. Use lower case for the upper case. No spaces has to be exactly that. And the browser goes and looks for this page as its initial first page. So call it index, click it say that. Let's add some basic html Okay. All of our metadata. So remember exclamation mark, return. Let's give it a title. This one here is called the idea restaurants, restaurants, restaurants. I can't spell restaurant, is that close? There's no spell check in here and I'm cheating as well. I'm looking at my notes like I've written it in there. I don't even know if that's about right anyway. So their restaurant is going to be my title and we need to create and connect a CSS sheet. So let's do that by going to file new and let's go to file save. We can give it any name. We like I was thinking about it before in between videos was like there was style. What is used to call it? Main all the time. Main dot CSS. It doesn't matter what you call it. The only problem is if you call it style and you're a web developer or designer and you're making like loads of websites, you can have lots of conf files on your desktop called Style. Okay. So it makes a little bit hard to find the one you want, but not that hard. Let's just call it style. Remember dot CSS if you forget like I do all the time. It's style. Okay. It doesn't work. But over here you can right click it, rename it and just put a dot CSS afterwards. So it knows now we're going to connect the two. Okay, so back to html and just under here under title, we're gonna put link and then click on CSS and it gets the right name because I gave you the right name. We're gonna hit save and that should work. Let's test it works. Let's just put in the body here, let's put in an H one now, I'm gonna show you a slightly different way of working. Okay. We're going to add shortcuts as we go around. If you feel like, man, I'm not ready for shortcuts. Just type in the long way. Okay, angle brackets each one close. It already does a little shortcut there but I'll show you a shorter, shorter shortcut. So I'm just going to type H1 and had returned, you can see there don't even have to put the angle brackets at the front. So I'm going to do that property for the rest of the course only because I do it at a habit and you might be wondering why. But anyway, Let's call this one. Do I work safe? Let's go to our styles. Let's add A style for each one. Okay. H1 curly braces will make it just change the colour. Is it not columns color? Okay. And we're going to call it. We're gonna give this one brown and it's got our semi colon in, we're gonna save it and let's go test it in a browser. So that's our old page that we're working on. I'm going to go to open file. Let's go and find it. So we're looking not for project zero. Now go to my desktop project one and there's my index dot html. Hey, there's my age one and he's brown. Now. A couple of other things. I want to show you envious. Code is this thing the Explorer. It's cool once you've used it for a while, but at the beginning you're like, it's a little bit confusing. So there's two sections to it. Right. I'm going to have these little chevrons here to kind of tidy it all up. Okay, so open editors. I never have open. That shows me when it means open editors that's an editor. That's an editor. It's showing me they've got these two documents open. Okay. I don't find that useful because I can see there project though. It's really helpful. Okay. That'll be the name of your website. So we've called it project one, but if you're working on this website, you might call it a deer website. Okay. And that will be the name there. Okay. And in here there's all the different pages you have. So in here, if you end up in project one creating a bunch of other pages, okay, Let's say we call this one, Contact us. Okay? We make a bunch of other pages. Let's make one more. Just kind of cheating. Right? You'll notice that. Can you see in here it's adding it to that project. It's going okay. I've looked in that folder and I'm seeing everything in there. Okay. And open editors is just showing me the two that I have open. I'm not sure if that's useful for you. I found it quite difficult getting my head around that weird little Explorer. There have been these guys, they're not anything. You see it updates. So instead of going file open, you can just double click these and we'll open them up if they're not already open like that. The other thing I want to do is I've got index and style and I toggle between the two and you spend forever toggling between the two. So I'm gonna show you a little trick not too many tricks earlier on. We're going to get trickier as we go. But this one is just it's good for teaching and handy for what we're doing. And if you click and hold the tab at the top so I'm gonna grab the word style. Hold it, hold it, hold it, dragging it around. You can see these boxes appear. It's a bit weird. You're like, is it that one that one move it around vaguely over here. Not too high, not too low about there. You can kind of see it's taking up half. It's got about like gray. It's kind of half of it. There we go. So the cool thing about it now is I can see my index and my style and I don't have to toggle between the two so I can go over here and say actually I'm gonna change this. I'm gonna add an H. One H two next to tab. What about this over here? You can see ah look I don't have to leave or toggle between two tabs and I'll make this one a color of red and now I'm browser refresh. It's not working at all. Why is it not working? You've noticed you're like ha ha I can't see it red do I work? So I didn't do save all. There you go. You know how I said before I ran into problems file. Save all because I saved this side. but not this side. I'll pretend like I did that on purpose. No, I didn't. All right, so it's a nice little helper thing to work through if you want to get rid of that. You can click on this little icon here. You cannot just split it again. Okay, close, close all close saved. I don't know which button to click there. You can drag it to be down here as well. Where is it? There you go. So it can be underneath. Alright, last little thing I want to show you is that you spend your life going from html putting stuff in and then styling in the CSS. So a nice way to kind of just split these up is you can be on any of these. Okay, and click on this little icon in the far right here. Give it a click OK? And it will separate them up. Does a weird thing I find that button, although it looks amazing. I find the easier way to do it is actually just drag it so that these two. Okay, so style dot CSS if you click hold and drag the name there, can just drag it over here, you can kind of see it makes this big gray box that appears and it's a little bit random in terms of where it ends up. Ok. But what we're looking for is vaguely in the top right here because we want that half. You can see so much time on that side. CSS on that side. You can close it down if you don't like that David. Okay. Open it up so it's two separate tabs. But I'm gonna drag it. You can have it down here as well, depending on your laptop. So I find my screen works really well for Oh, I just mixed them up. You can man, I find that hard. You can put html above CSS. I never do it that way. I always have it over here. There we go side by side up to you. So now I can go into here and say actually I want an H- two tab. How about this 1? And then over here I can type in Leave my bracket there. I can type in H. two. You can see it's handy color. Blue. Save check in the browser. Brother chick. Nice. The one thing you need to do as well is you need to go file save all I find I accidentally hit save my cursor is flashing over here. So if I watch this, if I add an H three H three. Okay. And stuff. And over here I start working and I add style my age. three color again. Whatever I save it. And I'm like hmm, refresh, refresh. Refresh. I've saved it. Okay. But because I've only saved the CSS. It didn't save my H three so I can spend ages trying to fix this problem like hmm. What is wrong with the code? And I spent ages trying to fix a problem that doesn't exist. It's just me being silly and not going to save all is the shortcut. So if you're in the habit of command S or control S, you need to learn the command S as your default save shave or on a pc. It is control Yes. To save all. Now. Let's have a look refresh. Yeah. Easy. All right. Let's get into the next video. Actually, no, I'm going home for the day. I've been recording all day and it is time for a break. And that will like tomorrow you'll hear either I'm more excited than depending on how well his baby sleeps or a less excited dan, depending how much coffee have had in between videos. But for you, it won't matter because I'll be right here in a second with the next video where we start looking at plug ins in ves code. I will see you then