Adding Images to a Website
Alright. This video is all about adding images to your html. It's pretty easy. Let's jump in now and learn how to do it. All right to add our image. We're going to put it inside the header. So clicking in between the header, angle brackets, put a return in and we're going to use I M G. That's the kind of shortened version of the tag that describes an image and hit return and puts in all the junk we need. Okay, so the image source. Okay. Just where it is and it's nowhere at the moment. So we need to put it in a place inside of our local folder. Okay. So let's do that first. So what we're going to do is we're going to jump out to our finder. So on a Mac, it's called a finder in your pc. It's called a window. Okay. So find your my documents panel. Get this up. Okay. And on your desktop inside of your project one we've got index and style but we need to put our image in here and it's really common not to just dump it. Sitting kind of in with these guys, you put them in a group. Okay. In it...
s own little folder called Images. So we're gonna right click. I'm going to make a new folder that's basically the same old Mac or Pc and either call I M G or images. I call it images half the world calls it I M G and the other half the world calls it images all images. It's not good or bad, but you have to take sites. So we've got a folder in there called images, there's nothing in it. So let's go into our exercise files, lets go to project one. And inside of here there's a PNG called logo Adair Restaurant. I'm going to right click it. I'm going to copy it. Where is copy? Are your shortcuts? You can tell, can I copy? There you go, copy Okay. Or command C or control C on a pc. Let's go back to our desktop and paste it in desktop. Project one images. Right click paste item. Okay. And there he is. So hasn't really done much. So I guess it brings up a really good point. Everything in this website needs to be in this folder called Project One. Remember it doesn't have to be called Project One, but everything has to be inside of here. Okay. It's called the root of the website. Okay. So it needs to know that this is home base and it doesn't need to know the rest of your computer exists. Just needs to know this like little folder. It's its own little world. So under Image source. So I just type it. I? M type it. I just started typing. I? M you can see it goes, hey, I've looked into your root folder and I've seen this folder called images. Would you like to use that? And you're like, I would if it doesn't appear it's probably broken and you need to go and make sure that images folder isn't the right place, but if it's still not working, just type it in. Okay? I M G. And then you need a forward slash to say I'm inside that folder and what inside that folder, there's only one thing. Okay. It's pretty clever. Now let's save it. Okay, save all and let's preview in a browser. There it is. He's left aligned. Okay. We're going to move it into the middle. But that's how you add an image. Pretty easy. The old text is super important when you're adding images and basically all this text is short for alternative and it just means if this image didn't load what text would best describe this image and this is going to be the logo for a deer restaurant. Is that what I've called? It? It is the restaurant. Can I spell restaurant that's close. Ok, so that describes that image and why we do it is for a couple of reasons, the visually impaired will have a screen reader. Okay, that will read them the website. So obviously if you can't see the logo, you need to be described what it is. So it needs to be a very good descriptor for people getting read out your website. The other thing is that google uses it to help kind of work out what your site is about. So if you just put logo, that's fine, but you might as well put in for a deer restaurant because if somebody is searching for a deer restaurants and your website is very clearly for a deer restaurants. Okay. It helps your rankings. Okay. So make sure all taxes really clear what it is, but also is very specific to your kind of target. In our case, we want people looking for restaurants in this town called idea where I'm moving to in a couple of weeks. Can't wait. Anyway, that's gonna be it for this video. We've put in an image. We'll do how to create images out of programs later on in the course. Okay. We'll separate that out. We'll do Photoshop and illustrator and XD how to make images. The one thing all you need to know if you are creating them now is that they shouldn't have any spaces if I have a space there or at least in the file that I've made in my images folder that shouldn't have any spaces. Same, same rules as naming. These shouldn't underscores or hyphens or it doesn't matter if it has no spaces. Okay, so just make sure no spaces. Alright now, the next video, let's go