How to change the layout of a responsive website for mobile vs desktop
Daniel Walter Scott
How to change the layout of a responsive website for mobile vs desktop
Daniel Walter Scott
Lesson Info
81. How to change the layout of a responsive website for mobile vs desktop
Lessons
How This Class is Structured
01:41 2What to Download
02:57 3Creating Our First Webpage
05:55 4What is HTML5 & CSS3
08:24 5Head vs. Body vs. Html Tag
09:01 6Title & Description
05:54What Code Editor Should I Use
02:42 8Using Diy Tags
06:26 9What is a CSS Class
09:05 10How to Create Nested Divs
05:03 11Class Project
05:24 12External CSS
09:07 13Creating Our Index Style Pages
12:16 14Testing Your Website
08:47 15Check Your Code For Errors
11:01 16What are HTML5 Structure Tags
05:47 17Add HTML5 structure elements
16:02 18How to Set the Color of the Background
05:10 19Adding Images to a Website
04:38 20How to Center an Image
01:14 21Change the Font Size & Color
14:11 22Make a Clickable Link
08:45 23Stretching Background Image
05:38 24Making a Div Tag Transparent
02:36 25Simple Website Text Navigation
06:43 26CSS Compound Classes
07:02 27Class Project 02
02:05 28Class Project 02 - COMPLETE
04:48 29Add an Email Button to a Website
03:49 30Add Google Maps to Your Website
11:25 31Making a Website Live
16:50 32Uploading via SFTP
11:50 33Setting Up Our New Project
03:46 34CSS Reset
15:22 35Min-height vs. Height
07:01 36Div Tags Onto One Line
05:23 37Getting div tags onto one line using Flexbox in HTML & CSS
05:23 38Evenly Spaced Div Tags
04:42 39Two Div Tags of Different Sizes
07:13 40Vertically Center Content
07:20 41Class Project 3
02:51 42Class Project 3 - COMPLETE
05:39 43Change Default Fonts
04:19 44Installing Google Fonts
12:44 45What are PX & EM & REM
14:56 46Change Line Height
04:33 47SVG vs. JPG vs. PNG
07:04 48How to Create a SVG, JPG, or PNG
11:00 49Block Images vs. Background Images
08:32 50Finishing Up Our Cards
09:10 51Icons via Font Awesome
16:31 52Making a Div Container Clickable
09:55 53Box-sizing & Border-box
06:19 54How to Make A Colored Button
07:46 55Why Can't I Add Margin or Paddding
11:08 56Rounded Corners
04:17 57Drop Shadows
06:24 58Backup Your Website
05:00 59Reusing a Button Class
03:10 60Class Project 04
02:58 61Class Project 04 -COMPLETE
05:45 62Adding a Horizontal Rule
03:51 63Make Divs Wrap Onto Separate Lines
12:14 64Hover Color & Animating a Button
03:33 65Pseudo Classes
09:31 66Simple Dropdown Navigation
20:04 67Adding Our Dropdown to the Website
14:50 68Useful Shortcuts and Tips in VS Code
13:28 69Large Background Image
09:24 70How to Connect 2 Pages
10:42 71Simple PHP Form Work
17:49 72Placeholder Form Text
05:46 73Multi Line Form Text Box
02:18 74Form Check Marks
03:04 75Form Radio Button
06:07 76Form Drop Down Menu
05:48 77How to Style Your Form
12:55 78What does responsive website design mean
04:17 79How to change a website layout size color when at different sizes using media queries
11:28 80How to test your website on a tablet or mobile phone from Visual Studio Code
06:00 81How to change the layout of a responsive website for mobile vs desktop
16:02 82How to turn things on and off for mobile tablet & desktop responsive websites
06:03 83What is pixel density responsive images pixel ratio dp px in webdesign
14:47 84How to export responsive images for website from XD Photoshop Illustrator
05:11 85How to add responsive images to website using 100% width in HTML & CSS
06:08 86How to use srcset to change images in HTML for responsive website
10:15 87How to add a css style to the first line of a p tag on a website (
11:18 88How to make the header footer full width but the inside centered
05:36 89Class Project 05 – Header design
03:12 90Class Project 05 – Header design COMPLETE
06:25 91How to use a span tag or span class in HTML to change text
10:32 92How to pin the navigation to the top of a website fixed nav
03:17 93How to make a simple responsive mobile menu using CSS only
08:21 94What is Javascript vs Jquery in website web design
06:35 95How to make a burger menu 3 line mobile navigation for a website
15:11 96How to switch a menu nav from desktop to mobile phone
21:45 97Overview of what Bootstrap 4 is in website design
07:57 98How to install Bootstrap 4 on a website using Visual Studio Code
06:27 99Quick overview of how the Bootstrap Grid Layout works in VS Code
10:49 100Quick overview of how Bootstrap Components works in VS Code
09:23 101Quick overview of how Bootstrap CSS Styles works in VS Code
08:20 102How to customize the default Bootstrap 4 css styles
13:51 103How to use Bootstrap Layout Grid Experiment 1
10:20 104How to make 100% header & uneven widths in Bootstrap 4
07:16 105How to create uneven col widths in Bootstrap 4
07:27 106How to add padding & margins using Bootstrap 4 in VS Code
12:03 107How to change layout of Bootstrap depending on mobile or desktop
15:46 108How to turn things on & off on your website using Bootstrap 4
05:30 109Google Chrome Inspect
12:40 110Add Shadows to Text & Boxes
07:06 111Change the Default Buttons
06:16 112Responsive Images in Bootstrap 4
09:34 113How to Center Text & Div Tags
04:16 114Customize the Bootstrap Navbar
07:29 115Add Your Own Logo
03:58 116Change the Default Nav Styles
12:12 117Fix the Navigation to the Top
04:41 118Col Images & Col Background
07:56 119Bootstrap Border & Rounded Corners
04:20 120Bootstrap 4 Carousels
05:13 121Card Groups
03:29 122Drop Shadows On Bootstrap Cards
02:25 123Clickable Boxes in Bootstrap 4
04:02 124Final Quiz
Lesson Info
How to change the layout of a responsive website for mobile vs desktop
Hi there in this video. We are going to take our sweet new media query skills along with some of our past flex box skills to do this. Go from desktop view where it's three across ready for tablet, tablet, tablet to look at that mobile one. Now this is proper responsiveness where we start changing the structure oversight to make best use of the screen real estate available. Let's jump into V. S. Code and work out how to do it. All right. First up, let's get rid of this stuff. Don't need the H one. Don't need the starting there. We'll leave our media queries. Okay? So when you are deleting the H one at the media query, don't delete the second brackets. Okay. Because it'll half work. The browser is pretty clever and c as well. I'm missing this but I'll still work kind of. Okay, So just make sure we don't. All right. We're going to add a container. Okay. Remember containers. Weird one where it feels like there should be like a specifically named H html five tag. Like what div and header bu...
t it's not. We have to call it a class called container. Okay. So this is where everything is going to go. Let's style this container. So we're going to do all of it in Global. We're going to say container. I would like you to be we'll put a background color in first to make sure it's actually appearing background color. I'm sick of these colors. I'm gonna pick my own by clicking on it and then dealing with the color picker. Cool background color. Let's preview, make sure it's working. Nothing is working. Why not? Because it doesn't have a height. I knew that. Okay, so we need a height and we're not going to use this regular height. Remember we're going to use min height. Okay. In height even I'm gonna throw in 500 pixels just so that there's some kind of guts to it. There it is there That is not, it can be any size actually I'll probably leave it off and just start building knowing that it will appear at some stage but it's a bit weird for classes. Okay, we're going to add a width like we did before, we're going to say a width of 10, pixels wide. Now, the problem with doing that A width by itself, like that is an absolute size. So it's going to always be 124 but I don't care if you're a mobile tablet. So what we're gonna do is we're going to say you can be a maximum of up to that. Okay, Because that sort of decided my like it's a bit weird having computer issues. Okay, so a max width is just going to say you go up to that but no further, but you can go smaller because that's just the maximum width. Alright, last thing we'll do is we'll get it to centered. Okay, do you remember what this was? Remember it was margin left and right. Set to auto. We're going to use our shortcut. Okay, so we're going to margin to the top and the bottom, we're going to be zero but the left and the right are going to be auto. So just the space between them that should work nice. So that's my container. I now inside of this container, I'm going to add a bunch of those kind of blocks you saw in there. So up until now we've been calling them cards in some instances boxes. Okay, in this case we're going to start calling them coals. Okay, sure. For column for no good reason, it's not like a predefined tag in here. It's just very common to use it. And when we start looking at things later on something called bootstrap, they use the word coal as a box instead of box or card tile. So we also just get in the habit of doing that. So I want 10 of them and I want inside of those boxes of one H one. So I'm going to try and impress you with some emmett. So what do we want we want to call? Okay, and inside of that coal. So the greater than bracket and so inside of it's gonna have an H one and I'll show you another fancy thing if you put in curly braces here and say so on boxing there, the curly braces is going to put inside of that H one. It's going to put some text just plain old text called box. Okay, so that's kinda half of what I want. Right? But curly braces return so that's kind of what I want. Okay, so, but if I do times 10 it's not gonna quite work because it's going to give me a call one coal and then 10 H ones. So remember we kind of did this before you put it in brackets, coding. Help tries to put two in them. So all of this to be working and you're like, that wasn't worth it and it totally wasn't. I just, I guess I'm getting used to this index showing you cool, helpful things like putting in curly braces and the other weird thing about it is that we're not weird. It's giving me kind of some nice structure but it actually looks a little bit nicer. If I just do it the long way. So I'm going to do cole I'm not going to going to use the right case. I was just duplicated. It seems easier in this case. So coal inside of here is an H1 inside of this is going to be box. That's what I wanted. Right? So to duplicate it, you hold down the option key on a Mac and the shift key down arrow. So that's option shift down arrow if you're on a Mac, Sorry, that was for a Mac. If you're on a Pc it's shift down arrow And you should count. I didn't count. We need 10 of them. I'm going to add numbering to them. That will help me and no fancy way that I know of for doing this except for ah look at that that went well. Let me guess the right number as well. That was just down arrow and start typing. Let's have a little look what we got. Okay, a bunch of boxes now let's style those boxes. So they're called coal over here, my global I'm gonna say dot cole you're going to be a color? No, you need to be a background color back. Ground color. Okay. And I'm going to pick any old color so I can click in it and pick a color that I like. Makes no real purpose. There we go. Just pick some nice colors down. Alright, so we've started the coal. Let's have a little look. Let's give it a width and a height. Sorry, going a bit fast. So yeah, it's just doing that because I have not given any dimensions. So let's give it a minimum height of I don't know, 200 pixels Nice. Let's give it a width. Okay, Because they're taking up the whole thing, let's see if the width will fix it. So instead of doing a max width or a min width we could do absolute sizes and start playing with max width but we're gonna use percentages which is basically the same thing because it's a it's not a fixed size And what I want in this case is let's look at our mock up. This is the desktop view. So I wanted to be about that. So three across and two across and one across. So kind of 100% width. This one is going to be 50% with fish. This was going to be 33.3. I'll leave it a bit of space in between them so it might just make this 30% across. Let's have a little look. It's not gonna work. Okay. The reason it's not going to work is why are they sticking on top of each other and not beside themselves or in line? You got it. Okay. So it is, we could say columns are display display in line. Okay. And you'd be totally right in line block. Okay. And that would work. Okay. But what we're going to use is go back to our flex box. Remember what we could do with flex box about display And we're gonna use flicks. It's going to be part of the thing for us. No, it's not display flex. 30%. Yes. Why are you displaying flicks? Oh, I've done to the wrong one. Has to be the parent. You remember that Dan. Okay. A good test for you to pretend it was a test. Okay. So the container. Okay. You applied to the container. So it applies to all the Children which are these coals. Let's have a look now. That kind of works. It squeezed them all in and by default it squeezed all 10 of them into the same row. Okay. And it made it 100% of the parent. What I'd like to do is actually do here do flex, flex wrap. Okay. And what kind of rap? Just the regular old rap. Okay, save it awesome. So 30%. They're rapping. Okay, so 30 30 30 we get we get to 90 K. Leaving our gap. So a couple of things actually before we go wrap you can you saw it there? I can't remember if I read reverse. Okay, so box 10 is at the top. Never use that. But it seemed I felt like I wanted to share that they're now what I want to do is put the spacing in. Okay. We could play with margins but remember that fancy thing we learned earlier on, we can justify the content. And we're going to use which one? Space around. Space between. There you go. Save it. There you go. Space around. Might be a good exposure. You'll see it here. I had to kind of like point it to you before, but we had a white background. So space around is evenly either side. Okay. And I never want that. I always want space between let's go add a bit of padding to the bottom of them. So the coals let's have a little bit of padding margin bottom of 40 pixels. Alright. It's looking good. Okay. The cool thing about them because the 30%. Okay, they responsive by themselves. They get to a max with okay, but they're allowed to go smaller, the container can get smaller. Okay, but they can't go past that and it's going to work for us at the moment. You could design for a heaps larger size and it depends on your audience but they might not have you might be designing a whole big website for all for people that just are never going to see it. There might not be that many people who have this ginormous desktop to you. Alright, that is it for that now I'm ready to adjust them for the different media queries. So down here and it's the same thing. So cole okay at our curly braces, I'm going to say coal, we're only going to do the width. Okay, so the width down here is going to be a different percentage so remember 50, it's kind of 50% for our tablet view. Okay, but a little bit less for this. So maybe 45%. I don't have to reiterate things like justify or flash flex wrap because it's already globally applied to everything. Let's have a little look. Alright, so just of you, Let's use our proper fancy one. Right click inspect. Okay, let's go to our show me decrees they're not on by default show show show. Oh they are right there in blue. Okay, Let's go to this bigger size. Alright. It's not adjusting its because of this. Okay. I left it said to IPhone four and it will not change. You could get the responsive and it will change. Okay, so Let's go big version three boxes go to this morning. Hey, it's only 45. The gap there is a bit big in the middle there so maybe 47 might be a better percentage. Okay, but you get the idea right? We did it with plain old H ones before now we're doing it with actually the structure of the site which is kind of tends to be more what you're doing. Okay, we've done it for tablet, tablet, desktop, tablet mobile. Let's do that. Next. Okay, so let's look at our media query here. Still you It's going to put in 100 because I don't have any gas and it's going to kind of fill it up probably. Here you go go. A little bit smaller, bigger 321. How cool are we? All right. And that is the kind of really big takeaway for this video is we're using the exact same thing. Okay. We have to do some styling to make it kind of looks like a website. We made some boxes but to do it with structure. All we really need to do is we need to add these two bits. Really we just need these two. Okay to get them in line and then to wrap onto the next line And then we just said at this different size, I want to change that. I don't want to be with anymore of 30%. It's gonna be 45. So we don't really say to rose or two on a row. We just kind of make it so that that happens by giving it a size that only allows for two to fit. All right, a couple of little things. One that I ignored is down here at mobile. You'll notice that there's still a white line around the outside. Okay. That's one of the first things I did, I'm like, man, that's annoying. Okay. So by default, you know like the default the H1 is black and it's times new Roman and it's nice and big and bold. It's the same with the body. The body has a global of margin. I can't I don't even know what it is but I always go through and set margin to zero. Okay, So that there's none around the outside at any of you. Okay. I didn't want it for any of them and it gets it from the top from the sides and from the mobile gets it right around the outside. It's nice and kind of joined up because on mobile you want every pixel counts right to get as much detail as you can into that width. Now we did it here and we're fighting with the defaults. Okay, so that is a really good opportunity to say actually I'm doing this, I'm about to build out some CSS resets myself. How about I just use that CSS reset? We already have. Okay, and we already got one. Remember we've got one, so I'm gonna delete that so it'll come back. Okay, I've got one. Remember the Rhys Meyers one. Okay, so I'm just going to copy and paste that and use that. So I'll show you what I do. Now as I dig around in my files for an old folder I'd go into here and say remember project to on my desktop there. Was that CSS reset? I'm just gonna copy it. Find my project three minds on my desktop. I had some shortcuts to speed things up. I'm just going to paste it in here, add it to my CSS Okay, it's a link. It's a link and it's a six S one and it's not called style so it's called CSS If you delete the text in here, it should hopefully suggest it CSS reset and I've totally done it wrong and you're like he's done it wrong. If you haven't gay, we'll discuss what I've done because it's actually done done. We wanted got rid of the margin around the outside for all the views. It also got rid of the giant text. Okay, it's now just a regular old size now, what it didn't do or what's going to run into problems later on Is let's say that I want to start the H1. So I go, Alright, each one now you are going to be a font size of let's say something big. 100 pixels. Okay, good awesome. Check it. Hmm, ticket, check it not working. Why is it not working? Okay, pause it. Have a think about it. Um pause it your own paws now. Okay, You didn't pause it? I know you didn't. It's this thing. Okay, they're in the wrong order. Okay, so my style is being applied. Remember the flow kind of goes along and it says alright, B and H one of font size 100 then this one loads. Okay, And if we have a look at that and take it over here, it says H one is a font size of 100%. Any other things that are telling you what to do? No, that thing is making us just go to 100% of the one. M Okay, So we're just gonna make sure the order is right way around. So you is there now that shortcut, you can just cut it and paste it Okay, above it. But if you click in it anywhere and hold down the option key on a Mac. Ok. On a pc. No highlight the whole line. Okay? And hold down the option key on a Mac OK. On a pc can you see I can kind of just tap my arrow key as long as I hold down my option or or alternate pc. I can just kind of move this thing along. Okay, So make sure the CSS reset first, then do that now. My phone size nice and big. I don't want get the idea to save it. Alright, So that's the kind of real foundation for our responsive website. There's a lot more to do. Okay. But that's the core of it. We're using flex box, which we kind of know or a little bit about already and we're using medical berries to kind of turn bits of CSS on and off. All right. I hope you're feeling good about responsive web design. I'll see you in the next video.
Class Materials
Ratings and Reviews
Viwosoft Technologies
Great tutorial - your clear instructions and concise explanations make learning HTML5 & CSS3 a breeze!
Student Work
Related Classes
Branding