Skip to main content

Responsive Images in Bootstrap 4

Lesson 112 from: Build a Responsive Website Using HTML5 & CSS3

Daniel Walter Scott

Responsive Images in Bootstrap 4

Lesson 112 from: Build a Responsive Website Using HTML5 & CSS3

Daniel Walter Scott

buy this class

$00

$00
Sale Ends Soon!

starting under

$13/month*

Unlock this classplus 2000+ more >

Lesson Info

112. Responsive Images in Bootstrap 4

Lessons

Class Trailer

Getting Started

1

How This Class is Structured

01:41
2

What to Download

02:57

Introduction to HTML & CSS

3

Creating Our First Webpage

05:55
4

What is HTML5 & CSS3

08:24
5

Head vs. Body vs. Html Tag

09:01
6

Title & Description

05:54
7

What Code Editor Should I Use

02:42
8

Using Diy Tags

06:26
9

What is a CSS Class

09:05
10

How to Create Nested Divs

05:03
11

Class Project

05:24
12

External CSS

09:07
13

Creating Our Index Style Pages

12:16

Project 1: Restaurant Website

14

Testing Your Website

08:47
15

Check Your Code For Errors

11:01
16

What are HTML5 Structure Tags

05:47
17

Add HTML5 structure elements

16:02
18

How to Set the Color of the Background

05:10
19

Adding Images to a Website

04:38
20

How to Center an Image

01:14
21

Change the Font Size & Color

14:11
22

Make a Clickable Link

08:45
23

Stretching Background Image

05:38
24

Making a Div Tag Transparent

02:36
25

Simple Website Text Navigation

06:43
26

CSS Compound Classes

07:02
27

Class Project 02

02:05
28

Class Project 02 - COMPLETE

04:48
29

Add an Email Button to a Website

03:49
30

Add Google Maps to Your Website

11:25
31

Making a Website Live

16:50
32

Uploading via SFTP

11:50
33

Setting Up Our New Project

03:46

Project 2: Bike Repair Website

34

CSS Reset

15:22
35

Min-height vs. Height

07:01
36

Div Tags Onto One Line

05:23
37

Getting div tags onto one line using Flexbox in HTML & CSS

05:23
38

Evenly Spaced Div Tags

04:42
39

Two Div Tags of Different Sizes

07:13
40

Vertically Center Content

07:20
41

Class Project 3

02:51
42

Class Project 3 - COMPLETE

05:39
43

Change Default Fonts

04:19
44

Installing Google Fonts

12:44
45

What are PX & EM & REM

14:56
46

Change Line Height

04:33
47

SVG vs. JPG vs. PNG

07:04
48

How to Create a SVG, JPG, or PNG

11:00
49

Block Images vs. Background Images

08:32
50

Finishing Up Our Cards

09:10
51

Icons via Font Awesome

16:31
52

Making a Div Container Clickable

09:55
53

Box-sizing & Border-box

06:19
54

How to Make A Colored Button

07:46
55

Why Can't I Add Margin or Paddding

11:08
56

Rounded Corners

04:17
57

Drop Shadows

06:24
58

Backup Your Website

05:00
59

Reusing a Button Class

03:10
60

Class Project 04

02:58
61

Class Project 04 -COMPLETE

05:45
62

Adding a Horizontal Rule

03:51
63

Make Divs Wrap Onto Separate Lines

12:14
64

Hover Color & Animating a Button

03:33
65

Pseudo Classes

09:31
66

Simple Dropdown Navigation

20:04
67

Adding Our Dropdown to the Website

14:50
68

Useful Shortcuts and Tips in VS Code

13:28
69

Large Background Image

09:24
70

How to Connect 2 Pages

10:42
71

Simple PHP Form Work

17:49
72

Placeholder Form Text

05:46
73

Form Check Marks

03:04
74

Multi Line Form Text Box

02:18
75

Form Radio Button

06:07
76

Form Drop Down Menu

05:48
77

How to Style Your Form

12:55

Project 3: Responsive Portfolio Website

78

What does responsive website design mean

04:17
79

How to change a website layout size color when at different sizes using media queries

11:28
80

How to test your website on a tablet or mobile phone from Visual Studio Code

06:00
81

How to change the layout of a responsive website for mobile vs desktop

16:02
82

How to turn things on and off for mobile tablet & desktop responsive websites

06:03
83

What is pixel density responsive images pixel ratio dp px in webdesign

14:47
84

How to export responsive images for website from XD Photoshop Illustrator

05:11
85

How to add responsive images to website using 100% width in HTML & CSS

06:08
86

How to use srcset to change images in HTML for responsive website

11:18
87

How to add a css style to the first line of a p tag on a website (

11:18
88

How to make the header footer full width but the inside centered

05:36
89

Class Project 05 – Header design

03:12
90

Class Project 05 – Header design COMPLETE

06:25
91

How to use a span tag or span class in HTML to change text

10:32
92

How to pin the navigation to the top of a website fixed nav

03:17
93

How to make a simple responsive mobile menu using CSS only

08:21
94

What is Javascript vs Jquery in website web design

06:35
95

How to make a burger menu 3 line mobile navigation for a website

15:11
96

How to switch a menu nav from desktop to mobile phone

21:45

Project 4: Bootstrap Yogurt Website

97

Overview of what Bootstrap 4 is in website design

07:57
98

How to install Bootstrap 4 on a website using Visual Studio Code

06:27
99

Quick overview of how the Bootstrap Grid Layout works in VS Code

10:49
100

Quick overview of how Bootstrap Components works in VS Code

09:23
101

Quick overview of how Bootstrap CSS Styles works in VS Code

08:20
102

How to customize the default Bootstrap 4 css styles

13:51
103

How to use Bootstrap Layout Grid Experiment 1

10:20
104

How to make 100% header & uneven widths in Bootstrap 4

07:16
105

How to create uneven col widths in Bootstrap 4

07:27
106

How to add padding & margins using Bootstrap 4 in VS Code

12:03
107

How to change layout of Bootstrap depending on mobile or desktop

15:46
108

How to turn things on & off on your website using Bootstrap 4

05:30
109

Google Chrome Inspect

12:40
110

Add Shadows to Text & Boxes

07:06
111

Change the Default Buttons

06:16
112

Responsive Images in Bootstrap 4

09:34
113

How to Center Text & Div Tags

04:16
114

Customize the Bootstrap Navbar

07:29
115

Add Your Own Logo

03:58
116

Change the Default Nav Styles

12:12
117

Fix the Navigation to the Top

04:41
118

Col Images & Col Background

07:56
119

Bootstrap Border & Rounded Corners

04:20
120

Bootstrap 4 Carousels

05:13
121

Card Groups

03:29
122

Drop Shadows On Bootstrap Cards

02:25
123

Clickable Boxes in Bootstrap 4

04:02

Final Quiz

124

Final Quiz

Lesson Info

Responsive Images in Bootstrap 4

Hello there we are. Going to work with responsive images. We've done it before earlier on so we're going to use those sweet new skills to work it with bootstrap. Okay, we're going to add this image here and we're going to get it so that it's stretchy. You see changes sizes and different media queries, watch it kinda stacks down underneath. We're gonna work through all of the different options with Bootstrap four envious code right now. Okay, so we want, we're looking at the mock up now so we've got our text and I want to actually put this image in over on this side. So there's a couple of ways of doing it and they will be will cover cover them in this video. Okay. And it really depends on the implementation. What I really want to do is this image to break down onto its own line. Okay, after it goes down to mobile you can see here, I want to kind of underneath the same sort of thing with the founder message. Okay, starts up their moves down but these little slider guys, okay, I'm just g...

oing to turn off. Okay, so there's lots of different implementations depending on what you want to do. So let's add the image to V S code, I wanted to be inside my jumbotron which finishes there, which is not quite lined up. There we go. Okay, so I want it just afterwards and I'm going to type it in here. I'm gonna say let's line it up with everything else in there. Image. Okay. Image Source. This one's going to images slash and this one is called Hero one dot PNG. Okay, because it needs a transparent background, I'm gonna make sure put my old text in their dans meet Yogurts. Yogurts, you can spell out a couple of ways. I'm destined to fail on that word, but there's my old text. Okay, so I've got an image. Let's see what it looks like by naturally by naturally and its habitat naturally. Okay, it's massive. Okay, by default and bootstrap images, try and stretch all the way out. You're like, that's not what I want. I want it small and over here there's a couple of things we can do. Let's look at the bootstrap documentation. Okay? And let's look under content. I know it's under content and images, you're gonna have to click around for a long time or do a search. Okay, so in images, all we need to do is we need to make, yeah, it kind of tells you what you need to do. So in our case if we want to make a responsive image, we need to add this tag called image or I. M G hyphen fluid. Okay, so that it kind of moves around, there's other ways we can turn into thumbnails by calling it. It's just have a look at this just because it's interesting, so we add the class I MG thumbnail to this thing so we've got you you you before the closing of the image tag, we're gonna put it in the class thumbnail. Let's have a look at her now. There you go. He's in a big white box with white background with rounded corners. Still too big but just so you know there are some strange classes but just other use cases we don't know what for this so this might be interesting. Okay I want it to be I want the class of maybe float right so I can push it over to that right hand side. Let's see how that works. So let's do that one. Let's see what happens. Okay still not working because it's too big. So what a lot of people do with bootstrap is they'll just give it a width in here. So let's say it's a width of let's say 500 pixels. Okay so it fits up the side and I'll give it a height okay of auto so that yeah the width you define and it'll just be whatever equivalent ratio is for the height and that's a way of kind of doing it. You're like okay we're getting there. Now I know in this case I wanted to be up so we're gonna have to add like negative margins and trying to pull it up this way maybe some absolute positioning. So I am going to show you a different way because you might be exactly where you need to be. You've got an image, it responds to different sizes and have a look. Get down. Okay doesn't get down small enough to fit and I haven't actually added the image responsive. Okay so let's go in there and do that. So I've floated it to the right but I also want is that I. M. G. Fluid. Okay so it actually changes size. Okay so you can see they're kind of getting bigger and smaller. Let's actually turn on the Inspector Adele device preview and now we're going to slide it in and out and you can see the image move that down a bit. Okay? It gets bigger and smaller because I've added that image responsive and that's kind of working for us, right gets to here and I just want to pop it up that way and you could chase the negative margin to pull it up maybe absolutely position it. So it kind of forgets about this and kind of moves up to the top but I know that's going to cause me problems when I want to on mobile remember break it down into its own line, okay to kind of separate it here. So what I want to do is actually just put it into two, like into a row. Like we've done lots of things right, put into a row and then have two columns that I can break on these two parts and we can just take like this one seems a little bit wider than this one. So this may be can be I don't know seven and this one could be five columns and then I can just On mobile devices make it 12 and 12. So let's give that a go. So let's have a look. And often you only get to this point where you're like actually be better in two columns after you've had a fight with float ride and negative margins and you're like give up, you're like actually, so let's get rid of height with okay that stuff we're gonna keep the image fluid and we're going to get rid of float white. So we're back to kind of just having it sitting there, no height, no width. We're gonna let the column width decide how big it is. Okay, so let's, first of all we're going to need this. Okay, so I'm going to cut it into my clipboard. Okay so I've gone to edit cut. Okay so I've got it somewhere. You can paste it, another document if you're worried about losing it. I always do or worry about it at least. And inside of here I want a row with inside of that. I want to columns please. Okay and these columns are going to have my, this first column is going to have all that stuff that I pasted. It's gonna have my H1 in my p. Tag and my a tag and all that sort of stuff except the image. He's going to go in this other column here now. One question you might have is like hey you didn't put like that internal diff we made the coal and then normally we put in, remember my box, we only added that my box. If we needed to change the column some way, we've been adding lots of color to the background and changing it a lot. We're not going to do any of that. We're just using it as a simple old container and we're doing stuff with this within it. I don't need to mess with the column. Does that make sense If I wanted to add margins to the column to the top or the bottom? Okay. I would actually put an internal Devyn here called my box and do it to that. Because remember, we don't like to mess with the coal cole knows where you live and we'll find you All right. So, it's gonna kind of work. Let's have a well, I hope it's gonna work. Let's have a little look. So, it's there. Okay. It's doing half and half. Ok. So, they're kind of 50 50. It's not quite what I need. So, I need it to be actually, I wanted to be not 50. About seven and five. We get to 12 columns, which is cool, Okay. And that's gonna kind of work. It's gonna work perfectly. Except now we want to work out the mobile. So that was great for this view when I get down to kind of, this sort of size. Okay, see this media career here, I guess is what this was, I think in your head. Okay. Which which media query is that? Is that the L. G. No, it's not. It's the S. M. So small, you know that you got it. All right. So, I want to so both this one and this one, I probably want them to be stacked on top because the image gets small, it's wrecking this and okay, it's got enough room here. It looks good. So let's attack that. So, what I want to do is instead of saying this one here is going to be my medium and above probably the thunder in the background. Very exciting here today. And not so good because I'm in a tin shed, exciting enough. Um so we are going to I'm distracted by the thunder and the realization that I'm gonna 10 big metal shed anyway, so what are we doing? Okay. We've decided that at large it's going to do it, but down here, okay. It's not doing anything. It's gonna we're gonna force it to be 12. So flustered. Okay, So we're going to say a coal 12, which assumes, okay, you mean extra small. And because I don't say small, it's going to assume it's 12 on small as well. And then finally, when it gets to the medium, it's going to say actually I'm going to override you. I'm going to go to five. So mobile first you got it have a look. I know it does it by default, but sometimes it's only because the content forces it to you're not really doing it. Okay. So it looks good. It's all stacked on top of each other and then boom and it gets to there kind of moves this, that's why I went for the two column approach because it makes this nice and easy. There's a few other things I want to do. Maybe lower the font size. Okay. When I get down to this one because it's kind of breaking in weird places and we need to play with padding and we need to center it because my kind of mock up here has the text centered on mobile. So we'll do that in the next video. That's of course if I'm here in the next video and not struck by lightning.

Class Materials

Bonus Materials with Purchase

Exercise Files
Completed Files

RELATED ARTICLES

Recent

Articles

Recent

Articles

Recent

Articles

Recent

Articles

Recent

Articles

RELATED ARTICLES

Recent

Articles