Daniel Walter Scott || VIDEO: 6 of 54
NOTE: this course uses Bootstrap 3. Dreamweaver has recently updated to Bootstrap version 4. You can change it back to 3 using the ‘New Document > Bootstrap > Preferences'. Please do this before starting the course.
Some versions of Dreamweaver will require you to download the specific Bootstrap version you want to use and link it within the site. You can download Bootstrap 3 here: http://getbootstrap.com/docs/3.3/
So first up we’re going to look at the components part of bootstrap. Then we’ll look at grid afterwards. So lets look at some of the components that bootstrap have created for us and we’ll compare, just to show how bootstrap is we’re going to show how to create them using bootstrap and then manually how to make them and the difference in timing and control. Let’s look at that, lets make a really simple thing, just a button. Just a clickable button in bootstrap and then we’ll make it by ourselves. I’m going to go to file new, under bootstrap I’m going to create a new everything, click create. Alright, so not a lot happens I’ve got my plain old document but if I go to insert and I go into button, so I’m in insert, and Im going to go to button - I get this, that is a button and it’s had some styling applied to it. So I’m going to save this document now and this is going to be my bootstrap test. We’re going to throw this document away so just a quick little demo. I’m going to create a completely new file using plain old HTML without bootstrap. Essentially the same thing to start with except it doesn’t have the backing of bootstrap. I’m going to save it, this is going to be called ‘plain-old-html’. Okay so if I add a button here, the difference is the styling really to start off with, can you see this button here is what you expect to see as a button straight out of code. This button here in Bootstrap is slightly more styled, the fonts different, there’s a bit of a gradient in the background. Not a big deal in terms of the styling, where it becomes quite cool is that lets check out bootstrap, so I’m on the bootstrap website and this is really handy to go back and forward from just to see what is available, you’re not going to remember exactly or every single thing bootstrap can do but it’s good to go in and check and see what it can do every now and again.
If we go to components, there is button groups, there’s all sorts of things to do with buttons. These are the components, you can see that there are dropdown, input groups as well as buttons. There are navigation in here, breadcrumbs, how to put in a jumbotron, thumbnails. This is all the pre-made components, we’re looking at just the buttons at the moment. So we’ve got out button, go all the way back to the top again and we’re going to look at the CSS that styles these now components. So there’s a whole bunch of pre-made CSS styles as well. We’re going to go down to buttons and you can see there’s my default buttons. There are options for the buttons, different colours you can use, different sizes, block level ones, so you can do lots with buttons without having to do all the styling yourself. So let’s give that a test.
I’ve got my button selected, I’m going to add a class. A class starts with a full-stop and this will bring up all the different button options from bootstrap. Now one of the ones on that last page is .btn-danger, and you can see by adding that class called button danger it’s gone red, it’s got white text so that the kind of things that bootstrap can do. It’s got some pre-made classes. Now to do the same thing here in out HTML document. I’m going to CSS Designer, I guess I’m just trying to prove the validity of Bootstrap or at least show you why people love it so much. So I’m going to ‘add new CSS sheet’, I’m going to name this one ‘plain-old’. I’m going to make a selector called ‘.btn-dan’ and I’m going to try and style it in the same way, so I’m going to apply that button now even though it has no attributes. So I’ve applied it great, it’s not doing anything so I’m going to give it a background colour of red. Oops, what am I styling? I’ve applied my class to this body tag which is the underlying one, not the actual button itself. You can see how easy it is, button or the body. So I’m going to remove it from the body, click on my button and reply that very same class. I should go through and create that sort of stuff but it’s the kind of problems you are going to run into so I leave them in there, I like to pretend it’s part of my training to show you what could happen, but really it’s just me getting lost. But we’re back! So this button here has got a classname ‘ban-dan’ linked to it. I’ve mad it red, I’ve gone to my type here and I’m going to make it white, it needs a bit of padding so I’m going to go up to this top one here called layout and I’m going to make it have some padding around the outside. So it’s going to have padding of maybe 5 at the top, 10 on the sides maybe 15 on the sides, 5 on the bottom, 10 there. Okay the font needs to be centred in here, now can you start to see the time saving by using bootstrap? I’m nearly there as in I’m almost getting this thing to do the same as this, it’s not the same but it’s kind of saved a bit of time. Now this is one little tiny part, buttons are really small. You can imagine where it becomes a whole lot quicker using bootstrap when you start looking at like an image carousel where theres lots of bits and pieces to it, start building it yourself? Could be a 2 day project whereas I’ll show you how it’s just a drag and drop using bootstrap.
So lets have a look at back to the bootstrap version, there are lots of different CSS classes that you can apply. Can you see here there’s the options, so we picked danger but theres some other ones. We can go through and theres sizes and all you need to know though is these names here, you won’t remember them all off by heart, don’t worry, but say I want to apply this btn-lg. All I need to do is type this in, the full-stop to make it a class, then ‘btn-lg’. So if I come in here, and I go full-stop btn-lg, it’s a large button! Some of the bits in the other side was there’s something called button block, so dot btn-block and that just makes it go full screen. So it’s a giant button that kind of spread out to the edges of it’s container. So then to go off and start building this in plain old HTML, I could definitely do it, no problem at all but I’m going to be playing around for a long time to try and get up to speed with bootstrap so it’s just a time saver.
Now let’s have a look at the magical bits of these components. Button- pretty boring Dan. So lets go and delete him, so I’m going to click on my button, hit delete, what I really want to do is to look at some of the really cool things. And we’re going to look at them properly later on but at the moment I guess it’s just a little fly through where I can say form, bootstrap components and these are the things that are kind of pre-made if you look a the bootstrap site, right at the top here, these are the components. So Dreamweaver has incorporated a lot of them in itself to make it easier to apply rather than copy and pasting code across, you just have to click some of these things so lets look at one of the more exciting ones. Lets look at carousel, and if I wanted to design my own carousel, A: You wouldn’t, but B: Even if you found someone else carousel to implement in your site, it will take a lot of working around to try and get going. Then will it work on all browsers? Probably, maybe? But I know Bootstrap is pretty good at working on all sorts of browsers and sizes and devices. Lets click carousel. Voila! One button and a carousel has been added. I’m going to preview this in a browser, I’m going to save my document, down to preview in a browser. And I’ve now got a responsive carousel. It adjusts, works with different sizes, click the button and it moves across. And all I need to do now as a designer is go through, okay there’s lots of things that I don’t like about it like I don’t need potentially this text or this second text but I can turn that off quite easily. The image in the background with the ugly white stripe around the outside, I can go through and adjust that and change it with my own images. It’s pretty damn amazing. and that’s why people love bootstrap, it’s quick, its easy, it installs a pretty plain-jane version of what you need, but it’s all done, all the bugs are worked out of it mostly and you can go through and add your own style to it very quickly and easily.