Google Chrome Inspect
Hey there, this video is all about how the hang do I know what's making this background gray and this button blue and the texas size in bootstrap when I didn't create it. Okay, so I'm going to show you how to use Chrome's inspect to dig around, find out what CSS it is and then decide whether to override or not to override. That is the question. So the main part is using Chrome's extension or chrome's developer tools, But we are actually going to remove the background and change the size and the color of the H1 while we're here. Alright, let's get stuck in. Alright, before we get started, we're going to talk about the the battle in front of us okay, this is going to be our biggest test yet and going to be the last thing for this course is project for our meaty yogurt goodness. Now this is going to put our, all of what we've known to the test okay, because we're doing not just building it ourselves with things, we know we're actually going to start interacting with bootstrap, okay, we st...
arted off building, just throwing in all the bits and pieces, remember jumbotron and drop down nav and so we threw it all in there, it was super quick. Now we're going to do battle with bootstrap using all of the knowledge that we learned earlier in the course and maybe you don't think of it as a battle, think of it as a puzzle, everything can be solved and I'm going to give you tricks in this next kind of section of the course to figure them out and we'll work out a bit more bootstrap penis. Alright, so let's get busy, let's jump back into V. S. Code. So I've closed down what we were working on before and reopened our index and style dot CSS okay, kind of looks like this at the moment, okay. And just in case, because we jumped in and out of this file a little bit getting kind of body going and messing about with it, so it's yours, if you find a little bit through this course or at least through this video you're like mine's not doing the same, you might want to go to the completed files and open up mine, I've made a special one instead of saving it at the end of the video, I've made this one that says begin, so the completed files will be in a folder in your exercise files, look for the one that says begin, if you want to kind of just like let's just start with dan's version, so that when I'm following along and I think I was wrong. Alright, so the first thing I want to do is we're gonna skip the nav because it is a little bit more complicated and if we learn some of the easier parts like this jumbotron and these cards then we can come back to the nav bar and it will be a lot easier, so we're gonna start with the jumbotron which is this big thing here. So let's go to venus code and what I want to do is I want to get rid of the great background first because look at it, it's not what I want on my design. So I'm checking you have got a mock up in your exercise files to see what we're doing. So exercise files project for Yogurt and there is a mock up, okay, there's a pdf in there with both kind of mobile version and the desktop version, so, and I'm going to open the actual file an XT so there is no background color, I'm going to see through to the background. We've already added the gradient earlier on, so now we need to remove the background color and this is gonna, this brings up a really good point, like how do I know what controls the background color of a jumbotron? Okay, we're going to use google chrome, okay, and we're gonna use this inspect now, this thing here is going to drive me mad, it's going to keep flicking the whole way through it, isn't it? It is, we'll we'll live with it. Okay, so up here we're going to right click anywhere kind of in the gray background. Okay, we're gonna go to this one says inspect now, what I'm gonna do is I'm gonna turn off my device preview so it just shows me the whole thing, okay and I'm gonna have to move up a little bit, I'm gonna hide that slighty thing because it annoys me. So we're gonna click this button here. Okay, this thing here is like an interactive moving around button that will start kind of highlighting things. Can you see the html keeping an eye on down here, it just kind of jumps and opens up depending on what I've got hovered above. So I'm going to kind of click where I feel like I've got the background of the jumbotron. Okay. And it tells you what classes are applied to the um div Okay, so something called jumbotron and over here it says the jumbotron class using the small size is giving it some padding. Okay, also jumbotron in general without a media query is telling it to have a margin at the bottom of two reams. Okay. And a background color of this. Great. And that's what I want to tackle. So I want to tackle the jumbotron. Okay, the background color and changed that. That's kind of the way of kind of digging into the bootstrap and working out what you need to change. You could go through the documentation and try and figure it out, but often easier. It's just a right click inspect and then turn this one on OK, and then click on it. So let's go find that. Let's make a class called Jonathan. So in our CSS Okay, I'm going to say dot jumbo tron Tron is going to have a background color. Okay, background cole of, I'm just gonna pick any old color and then put in my closing semicolon and I'm going to hover above it and get this random thing that pops out and then I'm just gonna go straight down to completely see through. It doesn't really matter what color it is as long as it's completely transparent. Okay so this last one needs to be zero. Let's check it in the browser and there we go. We've removed that background that little guy's still sliding but we removed that background colour. All right. Next thing is this H let's mess around with the size do size and color and it's not quite matching my mock up. Okay my mock up. I want it to be about 70 pixels. Okay. And and hear what I can do again I can click on this little inspect element and then click on it. Actually can just hover above it didn't say it. It did. It says it's font can you see just above it? I cant really click on it. Okay but it says the font is 56 pixels Which is weird. You're like, Hey I thought it was being you can see it over here. Right? I've clicked on it. It said it's being displayed for which is making it 1.5 reams You're like why is it 50 over here or 54? It's because actually this is like telling the browser it should be 3.5 times the default size the browser does the calculation and it ends up being 54. So that's what the CSS is saying. The browser kind of sees the end result. So I wanted to be exactly 70. Okay and this would be a good case of going over and say actually I'm just going to override the H one. Okay I'm gonna say your H. One R. A specific font size of 70. Okay font size 70 pixels is what equals okay it is 70 times It was a .06 - five. Are you remembering that yet? You've written it down somewhere? Okay so 4.3 So I wanted a bit higher so I could say that now I want that to be four point I could just say 4.3 R. E. M. S. Okay and with that work probably not because what's in let's have a look I can right click it inspect you can see over here it's still 3.5 and it's telling me down here look your H one is trying to tell it to be 5.4 point three but it's been crossed out and overridden by this one. Why back to this thing called specificity. Okay so in here H one is very vague. Okay you can ch one is what is applying to this but then there's a class on top of it. There's a lot more specific to say do this other thing. So it's overriding it. So if we want that to take effect, we need to delete this class of it and it will work. So look Now you can see it is 4.3 rings or rims. Okay. And right clicking it up here, inspect actually used to use this option. Okay. And you can see it is 68.8 pixels because I left off some of that should have put in 3.75 to get it. Exactly. Okay, so that might be a case where you're like actually that's a good idea. I'm going to get rid of all that but to override or not to override. That just totally works. Let's say I don't want to do that. I want to kind of keep it nice and clean. Okay. Because we worked out over here and undo it that four was close. I wonder if I could go up to five. Okay. Five. Okay. What is display five? We'll check in a sec but let's just have a go. Okay. It's a lot smaller. So it's the other way we want to go. Three gets a bit bigger. You can see there it's actually at 72 pixels now. Okay. Which is like it's as good as 68 was okay in terms of being off a little bit. So there are lots of classes to control things like font sizes. Let's have a little look. So our bootstrap documentation knowing where it is is troublesome in the documentation. Okay, so you can start with the search. Maybe do a google search but you'll end up under content and typography. Okay. And in here these are H 12 and three. That's what they look like by default. And then underneath it a bit further down other displays. We kind of touched on this earlier. You can see 1234. There is no five. Maybe it just defaulted back to none when I put on five. Okay, so you can work with these if these work Perfect, you're away. They don't then you're going to have to start overriding it with your own custom styles. Okay. Sing with the font color. Let's say that I want to go through. I could style this and give it a color. Okay, so I could go font color white. But is there a class. Okay. And in here under topography. Think it mentions it down the bottom color color, color color. Somewhere in here. Where is it? I think it's actually under utilities colors. There it is there so primary text colors, you can see there's a bunch of them. There's primary secondary success. Okay. We're going to use we're looking for white. So text white is going to work. So let's go and grab that. So instead of creating a class over here making it white, we can just say actually you have that and you are text. What does it say? Dot text. Okay. What? Let's have a look browser and it's white and this is a very good point. You're like, why did I do? Is it which one? Okay. It doesn't matter. Okay. You're gonna get half used to this. If you're going to embrace bootstrap because you're going to work on other sites, potentially that has bootstrap and while making the text white is not that important. What what tends to happen is these get baked in with other things. They do not just making it white or in this case it does. But let's look at remember we're using the coal. Okay. For the columns, we know that that's got lots of other stuff going on where it breaks down on different media queries and all sorts of other cool things. So as a kind of a blanket rule, I would try and do it in your html using pre made classes. You're going to run into less problems unless you're, you know, until, because if you start trying to override lots of things, it can cause like knock on effects. Alright, so we've removed the background color of the jumbotron. We have changed the H one over here. Okay. Using bootstrap stuff and I guess the big reason we did this video is showing you how to use google chrome's inspect. So let's show you one other Cool little thing you can do is let's say that this moving out. You know, what are these, what controls these? Okay. we're gonna right click them go to inspect. Okay. And it's gonna highlight it and say that it is. What did it say down here? It's highlighted in blue and says it is the class called Carousel. I control next icon. Okay. And that's what that does and you're like, how do I know now? You can go off and find that class and make either override amends or find other options using bootstraps documentation. What would we do if we typed in? I happen to know it's prepped not previous. Okay. And I click somewhere else. Can you see here? It's moved to be the other way around and it's just a good example of I can actually edit the code over here and over here while I'm in chrome just to kind of like test things rather than going back to here doing it here in my like working copy and then testing it and undoing it. You can actually do it in the browser using google chrome's inspect. Let's say we want to change the color of this. Okay. Or the color of this blue thing. Okay, so I'm gonna right click it, inspect it instead of going back and figuring out what button primary is. I can go in here and say all right, there's a color called this. Okay. I'm going to turn it off to make sure I'm attacking the right thing. It doesn't seem to change it at all? Border color off. Where is it getting its color from now? Because that was the hover. So you down here? Ah there it is. Okay, so I don't want to mess with the hover, I wanna mess with this one because that's where it's getting its kind of like initial color from and I can change it in here, I can say actually your F. F. F. F. F. F. White, Okay. White text on a white background. Good work then. But I guess I go and I want to show you how you can just mess about with things in here and just kind of test them using google's inspect before going and working on your own document. Alright, that's it for this video, Google chrome, inspect the developer tools. Super helpful. Let's get on to the next video.