navigate site menu

Start learning with our library of video tutorials taught by experts. Get started

Up and Running with Bootstrap

Up and Running with Bootstrap

with Jen Kramer

 


Bootstrap is a free web development tool from Twitter that, with a little bit of CSS and JavaScript experience, makes building websites quick, intuitive, and fun. Author Jen Kramer explores its 12-column grid layout; typography and icon libraries; fully functional components like nav bars, buttons, and tabs; and much more. This course also shows how to add JavaScript extras like dropdown menus, modal windows, and photo carousels.
Topics include:
  • Understanding the difference between default and fluid grids
  • Nesting with fluid grids
  • Creating a thumbnail gallery
  • Adding block quotes and lists of text
  • Incorporating images and icons
  • Adding breadcrumb navigation and pagination
  • Using tabs and pills navigation
  • Making the nav bar responsive with JavaScript
  • Adding dropdown menus to the nav bar, tabs, and pill

show more

author
Jen Kramer
subject
Web, CMS, Blogs, Responsive Design, Web Design
software
Bootstrap 2
level
Beginner
duration
2h 38m
released
Oct 12, 2012

Share this course

Ready to join? get started


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:04Hi, I am Jen Kramer. Welcome to Up and Running with Bootstrap.
00:09In this course I'll show you how to download the Bootstrap framework and integrated CSS
00:14and JavaScript into your website.
00:16Then we'll cover Bootstrap's responsive 12-column grid system, which makes web page layouts quick
00:21to assemble but provides lots of flexibility.
00:24We'll also look at the CSS styling that comes with Bootstrap, including the right way to
00:29override and tweak those styles for your own sites.
00:32We'll explore navigation systems that come with Bootstrap, including tabs, pills, as well as pagination.
00:39Finally, I'll go over some cool JavaScript effects that come with Bootstrap, including
00:44modal windows and a fun photo carousel.
00:47So let's get started with Up and Running with Bootstrap.
Collapse this transcript
Using the exercise files
00:00Exercise files are available to Premium Members of lynda.com.
00:04Simply download the exercise files to your computer and place them on the Desktop for ease of access.
00:10The exercise files are organized by chapter number.
00:14Whenever an exercise file is available for a video, you'll see a yellow overlay at the
00:19bottom of the screen that indicates the location and the name of the exercise file.
00:24In most cases, there is a starting state HTML file available to you in the exercise files,
00:30as well as a completed state file.
00:32The completed state file is located inside the folder called Completed.
00:36In a few videos, I've given you some images to use.
00:40Drag these images to the IMG folder inside of your Bootstrap folder on the Desktop.
00:46You'll be creating this Bootstrap folder in the first few videos as you download Bootstrap
00:51and start working with it.
00:53Working with the exercise files can add great value to the training.
00:57However, if you don't have access to the exercise files, you can still follow along with the
01:02videos, often using your own files and have a fulfilling learning experience.
Collapse this transcript
1. Getting Started with Bootstrap
What is Bootstrap?
00:00Bootstrap is a front-end framework created by a designer and developer at Twitter to streamline building websites.
00:06Front-end refers to the client side of a website.
00:10That's the part of a website that's displayed in the browser window.
00:13A framework is a bunch of code that's been written for you already, which you can use
00:17to build your website.
00:19You can find Twitter Bootstrap at getbootstrap.com.
00:23Pre-written code, that sounds like a terrible idea, doesn't it?
00:27It sounds like you can't adapt it, you can't make it match your Fireworks or your Photoshop
00:32design, you have to stick with what you're given.
00:34A site built with Bootstrap must be immediately recognizable like the default WordPress, Joomla!,
00:39or Drupal templates and themes are instantly recognizable.
00:43Fortunately, that's not true.
00:45Think of Bootstrap as a productivity tool for building websites quickly and easily.
00:50Bootstrap supports both adaptive layouts and responsive design, depending on which type
00:56of grid you choose.
00:58You can also pull out the responsive elements and build a standard website, if you prefer that.
01:04If you're not a designer, you'll love how many elements of the web page are designed
01:07for you plainly and simply, so you can make a reasonable looking website quickly without
01:13worrying about all of the design details.
01:17Designers will love how easily they're able to override colors and styles in Bootstrap,
01:21so you can leverage layouts and JavaScript effects but tweak the CSS to make the page
01:25look exactly the way you want.
01:28Bootstrap itself comes with CSS, JavaScript, and a few optional image files that you can
01:34use on your website.
01:36A 12-column grid system is available, as well as multiple navigation systems, including
01:41drop-downs, tabs, pills, and buttons, as well as cool JavaScript effects, like modal windows
01:49and image carousel and much more.
01:52You can find examples of websites built with Bootstrap at builtwithbootstrap.com.
01:58Next, let's download Bootstrap and examine its file structure.
Collapse this transcript
Downloading and unzipping Bootstrap
00:00Now that you know what Bootstrap is, let's download it and get started working with it.
00:04So to do that, go to getbootstrap.com, and you should see a web page that will come up,
00:10fairly similar to this one.
00:12Today I am working with Bootstrap 2.1.1, which was released on September 4th in 2012.
00:19It's possible that you'll be working with a later version of Bootstrap, but it should
00:23be fairly similar to this in terms of there's a great big huge honking button on the homepage
00:28that says Download Bootstrap, and that's what we need right now.
00:31So if you go ahead and click on this button to download Bootstrap--I am going to go ahead
00:35and save this file on down to my Computer and say OK-- it will go ahead and download Bootstrap for you.
00:43And now if I go into my Computer and go to my Downloads folder--Mac people you're going
00:50to do something similar--and I'm going to double-click on my bootstrap zipped file to
00:56decompress it, and I'll have a folder here called bootstrap.
00:59What I am going to do is just drag that right on out to my Desktop and close that window.
01:06And if you open up the folder called bootstrap, you should then see three folders inside of it,
01:10one for CSS, one for images, and one for JavaScript.
01:15So in the next video, I will show you how to set up a starting Bootstrap HTML document using Dreamweaver.
Collapse this transcript
Setting up a Dreamweaver site with Bootstrap files
00:00Now that we've downloaded our copy of Bootstrap, let's get started building our first HTML
00:05web page inside of Dreamweaver.
00:07I'm using Dreamweaver for this particular course because I've worked with Dreamweaver
00:11for a long time, and I'm familiar with it as an environment for editing HTML and CSS.
00:16You certainly don't have to use Dreamweaver to accomplish what I'm going to show you here,
00:20and in fact, we're going to be working in code view most of the time.
00:23You're welcome to use any sort of program whatsoever that will allow you to edit HTML
00:28and CSS files. That's what we'll be doing for the most part in this course.
00:32So I'm in Adobe Dreamweaver CS6, I'm in the default designer view, as you take a look at the screen here.
00:38So if you want to make your screen look exactly like mine, over here at the top right there's
00:44this item for Designer view. Make sure yours is set to Designer view, and then here where
00:49you see this thing called Business Catalyst, I'm just going to go ahead and close that
00:52whole tab group. We won't be using it in this course, and I'd like to make a little bit
00:56more room for my files which are down here at the bottom, so I can see what's going on.
01:01As always, when we start working with Dreamweaver, the very first thing to do is to make a Dreamweaver site.
01:05So I'm going to go ahead and do that now by going to Site > New Site, and I'm going
01:11to give this site a name. I'm going to call it bootstrap, and I'm going to indicate where
01:16my local site folder is located, and I can do that by clicking on the folder icon here.
01:21I'm going to go to my Desktop, and I'm going to go to my bootstrap folder right here on
01:26the desktop, and inside of that are those three folders that we just downloaded from
01:30getbootstrap.com, they're all present there.
01:33Go ahead and say Select and then say Save, and you should see those three folders now
01:38show up over here on the side inside of the files, paneled over on the right side of Dreamweaver.
01:44The next thing, once we have the Dreamweaver site established is to create a new HTML web page.
01:50So to do that, go to File > New, and you get this grid of options that you can choose from.
01:58We're certainly going to build a blank page. Don't be confused by the fluid grid layout.
02:02This is a Dreamweaver-based fluid grid layout, it has nothing to do with Bootstrap's grid
02:06layout, which I'll be covering in some later videos.
02:09So we want just the blank page.
02:11It's going to be an HTML page type, and then for the layout, none of the layouts need to apply.
02:16Over here for the doc type, make sure you choose HTML 5, because that is what we will
02:21be working with for Bootstrap, which is designed to work with HTML 5, and then go ahead and
02:26say Create, and you should see a document very similar to this on your web page.
02:32So first thing I'm going to do is change my title from Untitled Document to
02:38Up and Running with Bootstrap, which is the title of the course.
02:43The next thing you might want to take a look at it is inside of your exercise files, I've
02:48given you a tiny little bit here of extra code that needs to appear inside of your Bootstrap document.
02:54One thing is this line here, this meta tag, this is a meta tag indicating that the viewport
03:00starts with an initial scale of 1.0. This is important in responsive design.
03:04So we're going to go ahead and copy this by doing Ctrl+C or Command+C to copy that particular
03:10text from the document, and then just after here, where it says meta characters set of
03:17UTF-8, I'm going to Ctrl+V or Command+V to paste that line of code right on into place.
03:23The next thing I need to do is attach the style sheets that I'll be using in this particular
03:28document, and we can do that over here through the Styles Palette which is located on the
03:33right side of the screen. If you just hit refresh, you should be able to see the Styles
03:38Palette as it normally appears.
03:40Down at the bottom of the Styles Palette there is a link icon to attach a stylesheet, go
03:45ahead and click that, and we're going to browse for our CSS folder, and inside of that, you'll
03:51find that there's actually four stylesheets that are available to you, and you're probably
03:56wondering what the differences are between these.
03:58So first of all, you'll see that there are two sets of two, really bootstrap and bootstrap.min,
04:05bootstrap-responsive and bootstrap-responsive.min.
04:08The differences here are the .min files are what are called minimized they've been processed
04:13so that all the space that is normally present in a stylesheet file has been taken out, and
04:19that will help the files download more quickly, which is great when you're actually using
04:24a production site, and you want to make sure your file sizes are small as possible so that
04:29mobile phone users have very, very small files to download.
04:32Since we're doing this in a development environment, I'm going to link to the full version of these
04:36stylesheet files in case we ever want to go and take a look at them.
04:39So we want the more human readable format.
04:42So I'm going to link directly to just the regular Bootstrap file here first, and I'm
04:46going to say OK. Dreamweaver is going to warn me that it's going to use a file path until
04:51I've saved my document, which we'll save in just a moment, so go ahead and say OK for that and OK again.
04:58So this has gone ahead and attached that bootstrap.css file to my document.
05:04Right after that, we are going to attach the second stylesheet, hit the browse button
05:09here, and we want the bootstrap-responsive stylesheet.
05:12Make sure the bootstrap-responsive stylesheet comes after the bootstrap stylesheet, because
05:18in some cases, this bootstrap-responsive stylesheet will override within the bootstrap stylesheet,
05:23so the order does indeed matter.
05:25Go ahead and say okay, it'll give you the same message again about the file path, and
05:30so now you can see that I have two lines of code here, one calling for regular bootstrap.CSS,
05:35one calling for the bootstrap responsive, and to make that code a little easier, I'll go
05:39ahead and save this now.
05:40So go to File > Save, and I'm going to save it right into the root of my website here.
05:47I'm just going to call this index.html, always a good named to call an HTML document, and
05:52you'll see that the paths here inside of Dreamweaver adjust accordingly and correctly to take
05:57a look at those two stylesheets.
05:59Before we leave the head of this document, there's one last thing I'd like to add, and
06:04this will come just after the CSS for the bootstrap-responsive. I'm going to put an
06:09extra space here inside of your exercise files. You'll see that I have a little snippet
06:14of code here, which is an HTML 5 shim.
06:18This is a particular piece of JavaScript that's available at Googlecode.com, it's designed
06:24to help backwards compatibility in Internet Explorer browsers.
06:27This itself is not part of Bootstrap, but it will help make your websites more compatible
06:33with Internet Explorer, and you can definitely just drop this right into your Bootstrap document
06:38to improve backwards compatibility, particularly with IE.
06:42So go ahead and highlight that code, do a Ctrl+C or Command+C to copy, and here inside
06:48of Dreamweaver Ctrl+V or Command+V to paste that on in, and you'll see that we have
06:53that particular little bit of code added as well.
06:55This is an optional bit of code, but I'm recommending that you add it. I think it'll save you some
06:59hair pulling later on as you do more with Bootstrap.
07:03All right, so now if you scroll on down your page a little bit you'll see that we have
07:06a starting body tag and slash body tag, put a few spaces in between those and just before
07:12the slash body tag, we're going to add some JavaScript declarations.
07:17So the first one that we're going to include is the script tag, and the source for that script tag will be
07:27http://code.jquery.com/jquery-latest.js and then a /script tag.
07:41So this itself will load the latest version of jQuery, which is a JavaScript framework
07:47from the jQuery website.
07:49So in order for this line of code to work, make sure that you are on the Internet so
07:53that it is able to download this little bit of code.
07:56If you're not on the Internet, you may want to go to jquery.com and download the latest
08:01version of jQuery creating that as a file and linking that up here, but if you use this
08:06specific line of code, even if jQuery continually changes its version, the latest version whatever
08:12it is will always be located here, and that's a great way to keep your Bootstrap site up to date.
08:17The next thing that we're going to add is a line of code for the specific Bootstrap JavaScript,
08:24and if you take a look over here in your local files, really quickly you'll see once again we
08:29have two versions of Bootstrap JavaScript.
08:32One is bootstrap.js, and the other is bootstrap.min.js. Once again, this is the minimized versions of the code.
08:39You can see the difference between 55K for the bootstrap.js and 25K for the minimized version of this.
08:48So by using the min versions, you'll definitely save some download time for mobile phone users
08:54in particular, certainly, those on dial-up as well.
08:57So since we're not going to be taking a look at JavaScript in great detail in this course,
09:01I'm going to go ahead and link directly to the min version of the JavaScript file.
09:06So we're going to go ahead and add that over here in Dreamweaver.
09:10Once again, script src=, and I'm going to hit this little Browse icon right here, go
09:18to the JavaScript folder and pick the min version of the JavaScript, and that will go
09:23ahead and put that path in there for me, close the tag, just like that.
09:28So this basic document that I've put together here for you is a great point for starting any Bootstrap web page.
09:36It's got everything that you need here, it's got the links to the stylesheets in the right
09:39order, it has HTML5 shim for backwards compatibility with Internet Explorer, it has a meta tag,
09:46that's important for responsive design, and down here, towards the bottom of the page,
09:49we've linked to both of the JavaScript pieces that are required to make Bootstrap work.
09:54So once you have this in place, we're ready to start building our first page with Bootstrap.
Collapse this transcript
2. The Grid System in Bootstrap
Understanding the difference between default and fluid grids
00:00Bootstrap ships with a 12-column grid system that comes in two varieties.
00:04I am on the Bootstrap website at getbootstrap.com, and if you click on the Scaffolding tab here
00:10on the top of the page, and you click on the link on the left side for the grid system,
00:15you'll see the Bootstrap's default grid system.
00:18As shown here, this is the default 940 wide grid.
00:23It's designed to adapt somewhat via adaptive layout to different screen widths.
00:27The numbers indicate how many columns wide each box is.
00:31In the first row, there is only one column per box, the next row is grouped into a few columns.
00:37If you roll your mouse over each box here in the documentation, there is a tooltip that
00:42will come up to tell you how wide each box is.
00:45That tooltip only works in the documentation, it's not going to work on your live site.
00:50Now you might be wondering, I just told you this is a 12-column grid, but yet when you
00:54look at this example here on the Bootstrap website, you'll see that it's only 9 columns, why is that?
01:01Well, the whole entire getbootstrap.com site is built in Bootstrap itself.
01:06The left column on this particular website is three columns wide, leaving nine columns
01:10left over for the main content area.
01:13In this example, for how the grid HTML works, it says that each row should comprise as many
01:19columns as its parent.
01:21So in this particular case, since the parent is nine columns wide, the grid example is
01:25also nine columns wide.
01:27Now if you click on the link here for the Fluid grid system--we'll jump down the page
01:31to that particular example--the fluid grid system is a true responsive grid.
01:37Note that it is 12 columns wide, even though this grid is embedded inside of the grid used
01:42to layout the web page. This responsive system is somewhat different.
01:47Since it's built with the columns of a percentage width instead of a fixed pixel width, you
01:52need to keep all of the grids to 12 columns, or 100%, no matter where they occur on your page.
01:58So this is an embedded grid of 12 columns wide, even though it's inside of a larger
02:04area that's 9 columns wide.
02:06Now I just used two terms to describe these grids, an adaptive layout, which is for the
02:11default grid system, and responsive design, which I'm applying to the Fluid grid system.
02:17Responsive design was defined by Ethan Marcotte in an article published at alistapart.com back in 2010.
02:23Marcotte said that responsive design contains three aspects: fluid grids, flexible images, and media queries.
02:32A fluid grid is one that's built using a relative unit of measure like ems or percent instead of pixels.
02:39Flexible image means that the images resize as part of the design, they generally display
02:44larger on a big-screen, and they scale down as the size reduces.
02:49Media queries are also included in the CSS3 standard, and they allow you to define different
02:54styles for different screen widths.
02:57Adaptive layout is something of a precursor to responsive design described on the alistapart.com
03:02website in 2006, by Marc den Dobbelsteen. This uses a fixed width grid instead.
03:09In the particular implementation we're looking at, the layout of the screen resizes once
03:14specific pixel widths are reached.
03:17This design may not fill the entire screen at all times the way a fully-responsive layout does.
03:22Many people, including Jeffrey Zeldman, argue for a broader definition of responsive design,
03:27one that will encompass adaptive design and adaptive layouts.
03:31However, as of this recording, these two approaches are viewed as separate.
03:35Bootstrap's default grid is the adaptive layout, while Bootstrap's fluid grid lets you make
03:40a truly responsive website. So which grid is best?
03:44Well, as always, it depends on what your goals are for this website.
03:48In general, many designers are leaning in the truly responsive direction using percentage-based
03:53layouts for their sites and images that resize.
03:56However, if you're not comfortable with that approach, you can certainly use the default
04:00grid and its adaptive layout.
04:02I will be working with the Fluid grid in this course, as I feel that the advantage of working
04:06with Bootstrap is the ability to make responsive websites quickly and easily.
04:10So we're going to take a look at the Fluid grid system in a bit more detail in the next video.
Collapse this transcript
Exploring the fluid grid and creating new rows
00:00Now that we are clear on the difference between Bootstrap's two styles of grids, I'd like
00:04to go into more detail into the fluid responsive grid to show you how to mark up a page with some content.
00:11So I have gone ahead and created this web page in a previous video, and I am going to
00:17go ahead and get started right here inside of the body tag building out some of the grids,
00:22so you can see how this works.
00:24So in general, when you start a HTML web page inside of Bootstrap, you are going to start
00:29it with a div--actually, start this really in pretty much any type of web page these days.
00:33You will have some kind of wrapper that goes around the entire web page, and inside of Bootstrap
00:40that would be a div with a class of container-fluid.
00:47So I am going to start by going ahead and putting that in place along with a closing
00:52div down here at the bottom.
00:54So that's going to encompass my entire web page, that's the outside wrapper.
00:58Then the next thing I am going to add to this is the start of my row.
01:02So if I have a div with a class of row-fluid, this will indicate where this particular row
01:12is going to start and stop.
01:15So this is the very first part of the grid, indicating where each row of that grid happens to be.
01:20Inside of that, I might have another couple of divs, so let's say I have a div with a
01:27class of span3, in other words span3 columns and put something inside of it.
01:34So we could say, for example, here's a paragraph, here is a left column on this web page, and
01:45end that particular div. Then I can have a second div inside of this row.
01:55So in this case, we have nine columns left over. So we'll put in a span9.
02:01So span1 through span12 are all the classes that are available to you, and each one of
02:06those classes indicate how many columns it should expand over. All right!
02:11So have a starting div here, we have an ending div, and then inside of that we've got some text.
02:17Here is the main content area of this web page.
02:25I put just a simple paragraph inside of each one of these divs here, but of course, you
02:29could have quite an extensive set of markup inside of each one of these particular divs,
02:34the span of 3, and the span of 9. You could have images, you could have headings, you
02:38could have any kind of markup that you want inside of those divs.
02:41I am making this very simple as the first example.
02:43And if you're wondering where that slash div went, it looks like it's moved off the page,
02:47so I am going to get rid of that little extra space there.
02:50So now, if we go ahead and save this web page, File > Save, I am going to go ahead and view
02:56this inside of Firefox. I can do that here in Dreamweaver by going to the Globe icon
03:00on the top and saying Preview in Firefox.
03:03You could certainly also preview this in Chrome or Internet Explorer, whatever you like.
03:08And you will see here that we have the start of a grid on the website, we have our left
03:12column, and we have a main content area.
03:14The main content area doesn't look that large because I only put in one sentence, but if
03:19you put in a more extensive chunk of text, you would see that it stretches all the way across the web page.
03:23Now I can already hear my friend Matt Thomas saying, okay, so you just put in a whole pile
03:28of divs into that markup, Jen, and that's not really semantically correct.
03:33Can we actually use real HTML5 markup and those HTML5 tags with Bootstrap?
03:40And the answer to that is yes, absolutely you can.
03:43So let's take a look at a way that we could do that.
03:45I have done this with divs to start with because pretty much everybody understand divs, and
03:50there are number of you who are just learning HTML5 at this point in time.
03:54So one of the things that we might want to have in our particular web page is we might
03:59want to include a header here at the top of our web page.
04:02So inside of our div with a class of container-fluid, I am going to go ahead and put in a header
04:08for this particular web page, and in HTML5, the tag that you use for this is the tag of
04:14header, which I can use here as well.
04:16So I can put in a tag of header, and I can give this a class of row-fluid.
04:24So, no extra div here in this particular markup, we just have the start of the header, and
04:29we have the finish of the header, and inside of that I'm going to put in the title of my web page.
04:36I might do that with an h1, and I am going to set this to have a class of span12 because
04:41I want it to go all the way across the web page. This is my first Bootstrap page.
04:50So there we have better markup there for our header.
04:53Let's go ahead and fix what we did before with all of those divs in the second row here,
04:58what is now the second row, we have the div with a class of row-fluid.
05:02This might be a section of your web page, so we can change the div class of row-fluid
05:07to a section with a class of row-fluid, and then inside of that we have a left column,
05:14and we have some main content. There are tags that describe that as well.
05:19It could be depending on what exactly is in the left particular area that this might be
05:24an aside, so an aside with a class of span3, and it's possible and quite likely, in fact,
05:33that whatever goes on the right side of this page is an article.
05:35So this might be the article tag, an article with a class of span9/article.
05:41So, now that I have got two rows here in my particular web page, I have a header, and
05:47I have a section, let's go ahead and save this web page and see what it looks like in a browser.
05:52Let's go ahead and say File > Save, and let's go ahead and view this in Firefox.
05:58So there's my heading, This is my first Bootstrap page, we have our left column, and we have our right column.
06:02So just because I have gone ahead and established this web page as having a left column and
06:08a right side with an article, doesn't mean that my next row has to be laid out exactly the same way.
06:14So I am going to go back to Dreamweaver here, just to show you how that might work.
06:18Perhaps I want to add a row that has a very large left column and a very small right column.
06:25So I am going to add a section, once again, to the class of row-fluid, and inside of that, perhaps I have the article
06:36on the right side, this time an article with a class of span9.
06:43I like the 9 and 3, I think that looks good, but of course you could divide those
06:48columns into whatever numbers you wanted to use. Here is another article, /article and
06:58maybe time we put the aside over on the right side, so aside class of span3, so maybe we
07:11have some more information about that article over on the aside, and I can close that, and I
07:19can close the section.
07:22So once again, just go to File > Save, and if I take a look at my web browser, you'll
07:28see that now I have a second row of information.
07:31We have our article on the left side of the screen, and over on the right side, we have
07:35more information about the article, that's that aside that I put in. It's in this case
07:39displaying in a right column.
07:40Okay, so the very last thing that we ought to do is add a footer to this web page.
07:45So I hop back into Dreamweaver here, HTML5 gives us a great footer tag for doing this.
07:51So in this case, footer will have a class, and I am just going to give this a span of 12
07:55so that it goes all the way across the page, and maybe I have some text in here, Copyright,
08:02and some bottom navigation, go here /footer, whatever it happens to be that we want to
08:11putting in for that particular footer.
08:14And then you should make sure that your /div is down here at the bottom. That /div closes
08:19the container-fluid from all the way at the top of the page, and we'll go ahead and save
08:25this one more time, File > Save, preview this in Firefox, and you'll see that we have a
08:32footer that's in place at the bottom of the web page.
08:34Finally, you might be wondering about the HTML5 markup that I just put into place, and
08:39that is currently being used in the web page that you just built.
08:43Bootstrap as a system and a framework indicates that it's mostly backwards compatible to IE7,
08:49however, sometimes you are going to find backwards compatibility issues with older browsers,
08:55particularly if you're working with these new HTML5 semantic tags that I just demonstrated,
08:59like header, footer, aside, article, and others.
09:03Modernizr is a JavaScript solution that can help make HTML5 backwards compatible with older browsers.
09:10It's not perfect, nor is it the only solution to make this work, but it is a solution that's
09:15widely used, and when you might want to try if you find your Bootstrap work is producing
09:19bugs in older browsers that you wind up having to support.
09:23You can find this by going to modernizr.com, and this particular website will explain everything
09:30that you need to know about Modernizr.
09:32Modernizr itself is beyond the scope of this course, but you can find it covered in other
09:36titles at lynda.com. Modernizr is indeed compatible with Bootstrap.
Collapse this transcript
Understanding fluid offsetting
00:00So here's the web page that we built in the previous video.
00:03What I really wanted to have happen is I wanted to have a left column of this page, and I
00:07wanted to have a few articles listed on the right side of the page.
00:11Although this third row looks like I have an article on the left side of the page and
00:15more information about it over on the right,
00:18it would obviously look a lot better if I had the articles all lined up one after the other.
00:23But for the second article, I don't really want anything to appear over in the left-hand column.
00:28So what can I do?
00:29In Bootstrap, this is called offsetting, and it's very easy to set up.
00:33So I can set this up such that I can have the two articles appear underneath of each
00:37other and not have a left column in the second row.
00:41Remember that every row has to add up to 12.
00:45There has to be 12 columns, no matter what you do.
00:48So offsetting is a way of allowing you to have those 12 columns represented, even if
00:53they're not all containing content.
00:55So, I'm going to go back to Dreamweaver here at the bottom of my screen, and I am going
01:01to make a couple of quick changes to this page.
01:03So just to make my articles stand out a little bit more here in the second row, I am on line
01:0825, I'm going to add an h2, and I'm going to call this Article title, and then down here
01:18in the second row, I'm going to get rid of this aside with class of span3 on lines 35 through 37.
01:24I'm just going to make that go away. I really don't want it.
01:28And I'm going to clean up the markup here in this particular article a little bit as
01:32well, so it has an heading, another article, and of course, underneath that would be a paragraph
01:41with whatever text happens to be contained in that article.
01:44So, now what I need to do is inside of this third row that you see here, we have a span9,
01:50but we don't have the other three columns accounted for just yet.
01:54So, the way to do this is to use the offset.
01:57So, I'm going to say span9 offset3, all one word.
02:03These offset classes, again, range from 1 to 12, and what they'll do is they'll add blank
02:09columns on the left side of your particular row.
02:13So, with an offset of 3, it's going to add 3 columns on the left side of the screen
02:18that will be blank followed by the article, which will occupy there 9 columns on the right side.
02:24So I am going to go ahead and save this page, File > Save, and I put this into Firefox.
02:31Now you can see that I have a left column on this web page, and I have the two articles
02:35that are appearing underneath.
02:37So all those line up a whole lot better on the page, or it looks a whole bunch better than it did before.
02:41I may also want to do something with this copyright.
02:45Right now the copyright is located down in the bottom of this web page.
02:50It's got a span of 12 on it, so it goes all the way across the bottom.
02:53Perhaps what I really want to do is shorten that up and have it appear just on the right side of the page.
02:58I can do that also with offsets. So I go back to Dreamweaver.
03:03Down here on the bottom rather than a class of span12, what if I did a class of Span2,
03:07and I did an offset of 10 and then down here on the bottom, I could put in a
03:15copyright symbol under Insert > HTML > Special > Characters > Copyright, and then I could put
03:25in some actual text here, 2012 lynda.com? Go ahead and save that. So File > Save.
03:36And now when I go back to my Firefox, and I Refresh my web page, you'll see that I've
03:40got the copyright statement is now appearing over towards the right side of the screen,
03:45exactly the way that I want it to.
03:47So in this particular video, we have taken a look at the offset property inside of the grid.
03:51This allows you to have a row with all 12 columns accounted for even if not all
03:5712 of those columns are going to contain some kind of content.
Collapse this transcript
Nesting with fluid grids
00:00On occasion, you may want to segment a portion of the grid that you're working with into smaller pieces.
00:05For example, here's the web page that we built so far in this particular chapter, and inside
00:11of the Content area, maybe we'd like to have two information boxes appear side by side,
00:16underneath the two articles that are present.
00:19Unfortunately, since that particular part of the web page has a span of nine, in other
00:24words nine columns, I can't make two evenly-sized boxes, because one will be four columns
00:30wide and one would be five columns wide.
00:33However, there is another approach that we can take to this.
00:36We could nest another row inside of the row so that we would have 12 columns to work with
00:42and then divide those 12 columns into 2 pieces of 6 columns each.
00:47This is called a nested row inside of Bootstrap.
00:50So I'm going to go ahead and implement one of these now.
00:53If you go back into Dreamweaver and open up your HTML web page, and I'm going to scroll
00:59on down past that second article here, and I'm going to add some more code.
01:03So I'm going to add this as a section with a class of row fluid, and I'm going to put
01:14in a div with a class of span9 offset3, and let me just close those before I
01:24lose track of those two particular tags.
01:28So if I went ahead and put it in my boxes here, at this point we could have one that
01:33was four columns wide and one that was five-sized columns.
01:35But I want are two evenly-sized boxes.
01:38So to do that, I'm just going inside div with a class of span9, offset3, I'm going to
01:44go ahead and add another row.
01:47So inside of this div, I'm going to go ahead and add another div with a class of row-fluid,
01:54just exactly the way we've done before, and then inside of that particular div I'll put in my two information boxes.
02:06So I could put in here a div with a class of span6, and inside of that I can put an h3,
02:20and we'll call that Info Box 1, and perhaps I want an image to appear here.
02:28So I gave some images with the exercise files, you should have copied those into your images folder.
02:34So I can go ahead and add those here, image source, and I can browse for those files.
02:43So inside of my images folder, I have art1, and I could put in a paragraph of information.
02:52Here is some text about the picture, and I'm just going to copy this one little chunk of
02:59code here, this div with a class of span6, I'm just going to do a Ctrl+C to copy it, and
03:05right after that /div, I'm going to paste that on in place.
03:11So we have Info Box number 2, and it will be art2 instead of art1.
03:17So now we've gone ahead we've added an additional row to our grid, inside of that row we've
03:23nested another row, and so we have to make sure all of those divs are closed and everything
03:29is looking good, go ahead and do a File > Save, and now when you take a look at this inside
03:35of Firefox there's our two images with the text underneath, and we have our two articles
03:41that appear on the top.
03:42This is a great opportunity to show you the responsiveness of the Bootstrap grid as well, at this point.
03:48Right now my browser window is maximized so it's occupying the full width of my particular
03:53screen in a very typical desktop configuration.
03:57If I resize my browser window slowly--I'm just going to grab the corner here and drag
04:04it on over--you'll see that my images are in fact actively resizing. That's part of the
04:09definition of a responsive website. You'll notice that the grid is resizing as well, continuously.
04:15You don't see it chunking as you move in to move the corner here, and it
04:21stays the same until it suddenly jumps to the next position. That would be an adaptive
04:25layout, that would sort of jump in between different sizes, but a responsive design should
04:30be continuous and smooth as you can see that this one is. And as I continue to go here,
04:37you'll see that the grid continues to adapt, so what you see going on here is at the very
04:42top of the screen, you see the left column where we had a span3 and the article with
04:47a span9, you see that those are actually stacked on top of each other, then underneath we had
04:53an offset of 3 with a span of 9 for those articles and for these info boxes.
04:58So you see here, that there's still some space over on the left-hand side, that's why they
05:03are not lined up completely, and as I start to drag this on over a little bit further,
05:08you'll see that we continue to resize according to the page, until we reach some final amount here.
05:14Notice that those images are continuing to resize as well, and if I scroll on down the
05:19page, you can see that--I think I've probably gone past the maximum here a little bit--
05:24but you can see that everything is appearing stacked on top of each other, which is the way that
05:29we would expect this grid to respond.
05:31So now we've taken a look at the three critical aspects of this grid and how they work together,
05:38including the actual grid itself and how we create any rows in it, and we've taken a look
05:42at fluid offsetting--so the concept of having some items shifted over a bit on the page--
05:48and finally, we've seen how we can nest a row inside of another row to achieve even finer control on that grid.
Collapse this transcript
Exploring Bootstrap media queries and device-specific styling
00:00One of the last things you might want to do working with your grids in responsive design
00:04inside of Bootstrap is you may wish to have some particular parts of the layout visible
00:10only on a desktop or visible only on a tablet, visible only on a phone, or you may want to
00:15hide on one of those devices, and Bootstrap includes some classes that will allow you
00:20to do exactly that.
00:21I am at getbootstrap.com, and I'm under the Scaffolding tab under Responsive design, and
00:28if you'll just scroll on down here a little bit on this page, you'll see a very useful
00:33chart here under Responsive utility classes.
00:36So this explains to you exactly how these particular classes work and what particular
00:42devices using those classes will produce content that's visible or invisible on certain devices.
00:49We're going to put those to work here in just a second.
00:51So, what I would like to do is I'd like to set up a row on the web page that we've been working
00:56on so far, and I'm going to have it set up such that I'm going to have some text that's
01:02going to show up only on certain devices, and the important part to remember about this
01:07is the way that these particular CSS classes work.
01:10First of all, the big hint here is these are CSS, so they are testing the width of the
01:18window of the browser, they are not actually testing the device, which is something very
01:25different that actually comes over as part of the header in the request process for getting web pages.
01:31This is just testing the width of the screen, so it's calling things phone, tablets, and
01:35desktops, but just by making your screen wider or making your screen narrower, you'll be able
01:42to simulate phones, tablets, and desktops, and they will work just fine.
01:47So again, remember that phone, tablet, and desktop actually refer to specific widths of
01:53the screen, and those widths are detailed right here. Phones are 767 pixels and below, tablets
01:58are 768 pixels to 979 pixels, and desktops are the default, something wider than 979 pixels.
02:06So inside of Dreamweaver, if you scroll it down to just before the footer here--let's
02:12go ahead and add another part of this web page. I'm going to add a section with a class
02:18just as we've been doing all along here of row-fluid, and inside of here I'm going to
02:26add three divs, so I'm going to say div with the class of span4. This is visible on the desktop.
02:40I'm going to add a second div with the class of span4.
02:47This is visible on a tablet, and then finally, a div with a class of span4, this is visible
03:00on the phone, okay. So we've got these all set up.
03:04Now what I'm going to do is I'm going to add classes here.
03:08So in addition to this class of span4, if you just put a space, that will allow you to
03:11play more than one class per particular HTML tag, and I'm going to say visible-desktop,
03:20on the second one here we'll say visible-tablet, and on the third one here we'll say visible-phone.
03:32So go ahead and save that, and now when I go to Firefox to preview this page, down here
03:40at the bottom you'll see this is visible on the desktop.
03:43As I make the screen smaller, and I pull it over a little bit, you see that text has now
03:52changed to This is visible on the tablet, and now as I pull the screen even further over,
03:58and it resizes again, you'll see down here at the bottom it says This is visible on the phone.
04:03So that's the way this particular classes work.
04:05The hidden classes work very much the same way, and you can give those a try on your own.
Collapse this transcript
Adding a hero unit
00:00A hero unit is a big area usually spanning the width of a web page that intends to draw user attention.
00:07For example, I'm looking at the lynda.com homepage, and this site is not built with
00:11a Bootstrap framework, but if it was, this particular area at the top of the page where
00:16you see the text here and the video over on the side, this would be considered a hero
00:22unit, and we're going to try implementing one of these in the new document that I'm
00:27starting for this particular video.
00:29So if you go to the new document that I've given you in your exercise files, open that
00:35up, we're going to go ahead and add a hero unit to this particular page.
00:39So, we're starting from the very beginning of a Bootstrap document here. So as we've
00:44done before, we're going to start by adding a div with a class of container-fluid
00:51to have that big wrapping div that goes all the way around the web page, and I'll close
00:55that down here at the bottom.
00:58And then just as we've been doing all along, we have to start a row, so I'll have a div
01:03with a class of row-fluid and a slash div down here, and then in between that I'm going to
01:14go ahead and put them in my hero unit.
01:15Now, in this particular page, the hero unit is really functioning as a big header at the top of the web page.
01:21It's the big thing that catches your attention, so I'm going to use the header tag from HTML5,
01:28and I'm going to give this a class of span12, because I want it to go all way across the
01:33page, and I'll go ahead and close that header down here at the bottom. I'm going to go ahead
01:39and add some text to this.
01:41In your exercise files on your desktop, you'll find a text document that has the copy in
01:50it that I'm going to use, so this will be the Roux Academy 2012 Art Conference, so I'm
01:57going to start by pasting that on in, and I'm going to put that in h1 tag, and then following
02:06that, I'm going to put in a bit more of a description, so I am going to put in a paragraph tag, and
02:13I'm going to follow that up with this text, right here, which I'll go ahead and highlight,
02:17Ctrl+C or Command+C to copy it, Ctrl+V or Command+V to paste that into the web page,
02:24and /p to end that paragraph.
02:27And then I'm going to follow that up with a paragraph and a link, href. I'm not going
02:34to link this anywhere, because this is just one page of the website. Obviously, you'd put
02:38a link in there if you're doing this for real, and I'm going to put in a learn more at the
02:43end of all of this.
02:44So, if I just save what I have so far--File > Save--and I open this up in my web browser
02:49by going to the globe here and saying Preview in Firefox, you'll see that we have a page
02:55with a header and some text in the Learn more link. It's not really anything exciting yet.
03:00It's not anything that we haven't already done in some of the previous videos.
03:03All right, so now that that's in place, let's go ahead and turn this into a hero unit, and
03:09the way that we do that is after the span12 we can add the class of hero-unit.
03:16So once again, if you save that--Ctrl+S or Command+S to Save--and bring up your web browser
03:21and view it in the browser, you'll see that immediately this has now been formatted very nicely.
03:26It's got a screen black box around it, the text is nice and large, it's definitely attention grabbing.
03:32One other thing you might want to add to this would be a picture. You can certainly
03:37add an image to this very easily. If I hop back into Dreamweaver, and I go ahead and
03:42add let's say just after this header right here, I can put an image source, and in your exercise
03:51files you'll find that there was an image in place that you can go ahead and use for this.
03:59Be sure to give it an alt tag always.
04:07Actually, before we close it, let me put in one more thing, a class of pull-right. And the
04:16class of pull-right is a utility class. There's actually a pull-left, and there is a pull-right.
04:23basically, these classes are designed to float an image left or right or anything else for
04:28that matter, other elements on your web page, and so if I go ahead and save what I've got
04:33so far--Ctrl+S or Command+S to Save--and if I refresh this in Firefox, and you take a
04:39look, there's my nice big image here to complement what I've done so far.
04:44The last thing that I want to do here to make this look like a real hero box is deal with
04:48that link to learn more, and I want to cover buttons in much more detail in a later video,
04:55but for now in Dreamweaver, if you happen into the href tag here, we're going to go
05:03ahead and assign three classes.
05:06So a class of btn or button, btn-primary, which controls the color of the button actually,
05:15and I'm also going to add btn-large, which will make it a very large button.
05:21So, once these three classes are in place, Ctrl+S or Command+S to save, and off to Firefox,
05:27go ahead and refresh, and you'll see that we have a very buttony looking Learn more link,
05:32even though that is just a regular old href type of thing.
05:36The styling that we've applied with Bootstrap gives it a very nice look for the button.
05:42So hero units are a great way to set off your homepage to really draw the user's attention
05:47to the website, make users aware of what's the most important thing on the web page.
05:52In this case, I've marked it up with a header tag. It certainly doesn't have to be marked
05:55up that way, it doesn't even have to occur at the top of your web page. You could use
05:59this hero unit anywhere you like within your document, but I think I've suggested a nice
06:03way of putting it to use, and you can go ahead and give this a try on your own Bootstrap websites.
Collapse this transcript
Creating a thumbnail gallery
00:00Thumbnail galleries are useful for displaying many images on a web page where the image is the main focus.
00:06You can usually click on these to get a larger version of the image.
00:10You can also use a thumbnail gallery for displaying photos and text on a page in an organized manner.
00:15Bootstrap does include some markup for creating a thumbnail gallery.
00:20And let's go ahead and take a look at that now.
00:23So if you hop back into Dreamweaver again, and we're going to scroll on down here, past
00:27the div class row-fluids, in this final/div right here.
00:31I am going to go ahead and add another row to my document.
00:35So to do that, once again, I'm going to make another div class of row-fluid, make sure
00:45of course that you close that div somewhere further down the page.
00:49And inside of this particular div, the markup that we're going to use for thumbnails is an unordered list.
00:56So I'm going to go ahead and start that with a UL, and I'm going to give that a class of thumbnails.
01:01Of course, don't forget your /ul somewhere down at the bottom.
01:09Once that's in place, the next thing we need to add is an li.
01:14This li, I'm going to have three thumbnails on my page. I want to have them all very next
01:19to each other in three columns.
01:21Since of course, we're working with rows and a 12-column grid, that would indicate that
01:25we need have a span of 4.
01:27So we're going to have an li with a class of span4 and of course our /li.
01:36Now within that I'm going to have a picture, I'm going to have a heading, and I'm going to have some text.
01:41And all of those together could be considered an article.
01:44So we are going to use the article markup for that.
01:48So we're going to give it an article with a class of thumbnail, and inside of that we'll put in our image.
02:01Once again, we can browse for that.
02:04The first one we're going to put is Jonathan Ferrar.
02:07So I'm going to go ahead and pick his photo here, make sure to give it an Alt tag,
02:18then we can go ahead and give this h3 for markup, Jonathan Ferrar, followed by some text.
02:28So the text is available to you in your exercise files, here we go, the very first one.
02:34Go ahead and copy that text-- Ctrl+C or Command+C to copy.
02:38I'm going to put this is in as a paragraph and then Ctrl+V or Command+V to paste that on in and /p.
02:45So that's our first thumbnail there in our grid.
02:48We have a single li; we have an article inside of that.
02:51If an article isn't appropriate to what you are doing, you could use a div or any other tag
02:56that is appropriate to nest inside of that li. I've put in my image, my h3, and my p.
03:02Now if you're doing this as a real thumbnail gallery in which you just have pictures, you
03:06don't have text following it the way I do here, where I have article class of thumbnail,
03:10you could use that as an href, that might link to the larger version of the thumbnail.
03:15The class for that href would still be Thumbnail, but you wouldn't have any of the text following this.
03:20The problem with doing that here in this type of context is that h3 and p are block level HTML tags.
03:28And you cannot nest the block level HTML tag inside of an in-line element like the A tag.
03:35So in this particular case, I'm using the article class here for containing those block level elements.
03:41I could certainly wrap an A tag around my image if I wanted to do that to make my image clickable.
03:45Okay, so now that I've got that unit in place, so I'm going to go ahead and copy just highlight
03:51those lines for the li and then Ctrl+C or Command+C to copy, hit enter a couple times,
03:57and Ctrl+V or Command+V to paste it in.
04:00And then what I'm going to do--get my indentation there.
04:05Then I'm going to go ahead and make a couple of changes for my next one of these.
04:09Jennifer Jerome is the next one up here, so I'm going to change the h3 here to Jennifer Jerome.
04:15I am going to change my image source here and go ahead and browse for Jerome,
04:28change my Alt tag, Jennifer Jerome, and then from the document here in your exercise files,
04:37go ahead and copy the text here--Ctrl+C or Command+C to copy and Ctrl or Command+V to paste--
04:44and then finally, one more time, go ahead and highlight that li, Ctrl+C or Command+C
04:50to copy and then Ctrl or Command+V to paste it in one more time, and we'll make these changes again.
04:57So the last one that we're dealing here is LaVonne LaRue, so go ahead and copy that text
05:02here, paste that into my Dreamweaver document, and put in LaVonne LaRue's right here.
05:15And then, of course, we need to change the image source and pick LaVonne LaRue from our
05:25images folder and change the alt tag.
05:31All right, so if we go ahead and we say File > Save,
05:36now we can go ahead and preview this in the browser, preview in Firefox, and we have something
05:42actually starting to look like a real web page.
05:45There's that hero unit at the top which we put together in the last video, underneath
05:49you see we have three thumbnails, right there one next to the other, some text that's placed
05:54right underneath all of those.
05:56If I make windows smaller, you can see that these thumbnails do resize.
06:00As we've discussed before, it is a responsive design that the images resize as they're required to do.
06:06And at some point, those images will cascade down so that they're stacked underneath each
06:11other as part of that grid collapsing as the screen size gets smaller.
06:16And as you can see, we can narrow that screen all the way down to the 320-pixel range, which
06:21is where a mobile phone would be.
06:24And you can see that those are all stacked underneath each other nicely.
06:27So the Thumbnail Galleries are very, very useful. You use them in a lot of different websites.
06:32I've shown you a Thumbnail Gallery here.
06:34We've had some descriptive text following each of these.
06:36You can certainly build a Thumbnail Gallery with smaller thumbnails, with images that link,
06:42and perhaps open a modal window or open in some kind of pop-up window that would show
06:46you a larger version of the picture. All of that is possible with Bootstrap.
Collapse this transcript
3. CSS Overview
Exploring basic typography
00:00Bootstrap comes with a number of built-in styles which you can use in your site designs.
00:05There's a few in particular that you might find quite useful.
00:08This is the latest HTML document I'm using in this video.
00:12This is schedule.html, and you see that the page is kind of boring looking.
00:18We've got a schedule. It's obviously a schedule. It's divided very nicely into sections here.
00:24We have a Monday schedule, and we have a Tuesday schedule.
00:27And it's easy to tell the hierarchy of the information, but it's not terribly exciting to look at.
00:32So we're going to add some styling to this over the next chapter's videos.
00:37There is some styling that's here by default,
00:39just by virtue of being linked to the Bootstrap style sheets.
00:43So as you see, for example, the text is displayed in Helvetica and Arial, as opposed to being
00:49displayed in just Times New Roman, which is the default if no styling is set for most web browsers anyway.
00:55There's some basic styling that's in place for the headers.
00:58These Learn more items are links, which you can see as you roll your mouse over them
01:02they become underlined, and they aren't the standard blue.
01:05So there is some basic styling that's here.
01:08It's just not a lot of styling, and it is still a very boring page.
01:12So let's see what we can do about improving this inside of Dreamweaver.
01:16So if you open up this document in Dreamweaver and scroll on down to around line 20--
01:23and line 20 is an introductory paragraph that summarizing what's going to be happening with
01:28this particular schedule-- it's just sort of the big summary of everything that happens to be going on.
01:34One of the things that we can do to make this stick out a little bit is to assign it its own special class.
01:40Bootstrap allows this through something called Lead.
01:44So this particular paragraph tag, I'm going to give it a class of Lead, or possibly it's
01:51Lead, because Leading is in fact added to this, but I like to think of it as lead because
01:55it is the leading paragraph, but then I'm not a designer.
01:58Anyway, if you go ahead and save this, so File > Save, and you open this on up in Firefox,
02:06and take a look at what you've done,
02:08you'll see that that leading paragraph has a little bit of a bigger text.
02:12It does have a little bit of more spacing between the lines.
02:15It stands out a little bit more than it did previously.
02:18Something else that we can do this page-- it's a very simple thing to do--would be to add
02:22some strong emphasis and some emphasis to the page.
02:27Strong of course, is the strong HTML tag which many people think at is making things bold.
02:32Remember, of course, it doesn't have to make things bold.
02:35Bold is the way something looks, it doesn't have to do with the actual markup of that
02:38tag, which is to strongly emphasize something.
02:42So what I'd like to do is I'd like to take these names like Art in Full Color and Art
02:47in Full Bloom, and I'd like to emphasize those within the text by making them strongly emphasized.
02:55And as for the artist names, I'd like to emphasize those.
02:59So for the first time in this course, I'm going to switch over to Design View here in Dreamweaver,
03:03because it's just faster.
03:04I can go ahead, and I can highlight the words here that I'd like to strongly emphasize,
03:10and click the B button down here in the bottom that actually adds a strong tag, as you can
03:14see here in this little line of HTML tags. I call it the breadcrumb, where you can see
03:18that the strong tag has been added.
03:21And then as we go down to little bit further down the page, we'll see LaVonne L. LaRue.
03:25I like to emphasize that, so I'm going to click the I tag down here. Notice that gives it the emphasis tag.
03:32And if we flip over to code view, you'll see that it is has in fact put in that markup there correctly.
03:37Both on line 22 here, it's strongly emphasized Art in Full Color, and it's emphasized LaVonne L. LaRue.
03:43If I just save that, and I take a look at it again in Firefox, you'll see that those
03:50words Art in Full Color are bold, at least appearing bold here, and LaVonne L. LaRue
03:56is emphasized here, and you can see that in the form of an italic name.
04:01I'm going to go through the rest of this document and emphasize Art in Full Color where it appears.
04:06I'm also going to emphasize Water in Art where it appears in the second section of the page.
04:11And I'm going to emphasize all of the artist names that appear inside of this document.
04:15And I'll see you in the next video.
Collapse this transcript
Including blockquotes
00:00In the middle of the page we've been working on between the two days of events, there is
00:04a testimonial, it's right here on the page.
00:07It's really, really easy to miss it, because it's pretty much buried in all of the text
00:12that's going on around it on the page.
00:14Fortunately, Bootstrap has some built-in styling that you can apply to a quote like this to
00:19make your text pop out just a little bit more.
00:22So if you hop on in Dreamweaver, and we're going to scroll down the page here to line
00:3038, and you'll see that we have the quote, "This is simply an amazing conference.
00:36I'm inspired by it each year I attend."
00:38That's a paragraph, followed by a paragraph with a person who said it, Katie Cross, and
00:44we're going to go ahead and give this a little bit of styling.
00:46It's not really marked up correctly anyway, because since this is the quote from somebody,
00:50it should really be contained within a blockquote tag.
00:53So we'll start with that, we'll give it a blockquote tag and indent the quote, indent
01:01the name of the person who said it, and /blockquote will close that.
01:07If we just do that, and we do a File > Save, Ctrl+S or Command+S to save and then view
01:13it in the browser, by Preview in Firefox, scrolling down to see it, you'll see that
01:19just by putting it in the blockquote tag and marking it up correctly, the text is automatically bigger.
01:25You'll see that we have a little border over here on the side which makes it stand out
01:29just a little bit, so that was a nice treatment that you can add to that.
01:33The next thing that I want to do is deemphasize the person's name.
01:37I want the quote to be more important, so I'd like the text to be a bit bigger, and
01:41the person's name to be a bit smaller.
01:44And one of the ways that we can do that is with a small tag. Small tag is one of these
01:48tags that's come back in HTML5, and we will go ahead and add that now.
01:55So right around the name of the person here, instead of just leaving it the way it is,
01:59we can put in small tag and /small on the other side of the person's name, and if we save
02:05that, and we hop back to Firefox here and Refresh the page, you'll see that the person's
02:12name becomes, in fact small, and it's also a lighter gray, scaled back in emphasis just a little bit.
02:19You'll also notice that it puts a character in front of that person's name, that long
02:24em dash that's there. So the tilde that I'd put in front of the name before when I typed
02:28in the text really isn't necessary anymore, so let's get rid of that.
02:32In Dreamweaver we can just get rid of that little character right there and then once
02:37again Ctrl+S or Command+S to save and refresh here in Firefox.
02:42So the styling for that quote is a lot better.
02:45One of the additional things that we can add to the blockquote tag would be the ability
02:49to float this quote left or right on the page, and so in Dreamweaver, if in the blockquote
02:55tag you go ahead and add a class of either pull-left or pull-right, this will float your quote on the page.
03:06So I'm going to go ahead and save that again. I'm going to take a look at that in Firefox.
03:12And so you see here that the quote is here, and it is indeed floated left, it's caused
03:18the heading here for Tuesday, March 6, to be pulled up on the page, which is what happens
03:22when you have a float that isn't cleared afterwards.
03:25So that could be a treatment that will work on some pages.
03:29It certainly doesn't work on the page that we're looking at here, but it may be something
03:33that you want to do.
03:33Remember, pull-left and pull-right are two classes that you can insert pretty much anywhere
03:39inside of a document that will cause that element to float left or float right.
03:44This one obviously would need a bit more styling if we decided to use it here.
03:48And it is possible to do custom styling inside of Bootstrap.
03:51I am going to cover that in a later video in this chapter, the correct way of doing
03:55custom styling with Bootstrap to keep your website maintainable.
03:59So I don't really like the way that looks. I'm going to go back and pull that class out in Dreamweaver.
04:05So I'm just going to get rid of that class of pull-left, but just know that it exists
04:08in case you happen to want to do that.
04:11So this is a nice built-in styling feature here inside of Bootstrap.
04:14We've got some start for styling the quote and making it stand out of the page a little bit.
04:19You can certainly enhance that with your own styles to give it a little bit more polish
04:23and stronger treatment if you wish.
Collapse this transcript
Including lists
00:00Down here at the bottom of the page where it talks about Exhibit Halls A & B, we have
00:04a couple of lists--actually we have one list. Right now, it's a single bulleted list that
00:09talks about smart displays that will be occurring in Exhibit Halls A & B throughout the week.
00:14And then under that we have a sentence that says to visit three local photographers who
00:19will be displaying their works, and it says something like Sam Gilmore: Ocean photography.
00:23Currently, those are marked up as individual paragraphs, and that is actually rather incorrect markup.
00:28It's still a list of things, Sam Gilmore is the photographer, Ocean photography is his topic.
00:34They go together, but they're not individual list items the way Area high school students
00:39or Roux Academy students or Conference participants are.
00:42The best way to mark up that particular laundry list of stuff down there at the bottom is
00:47really a definition list.
00:49A definition list is something that is not typically used a whole lot inside of web pages
00:54at this point in time, but it's incredibly useful.
00:57It's got a two-part list, so there's a definition term and a definition itself, so things can
01:02be paired together inside of a list.
01:04So I'd like to have marked that particular group of items up correctly, and let's take
01:10a look at some styling that Bootstrap offers for dealing with lists.
01:14So inside of Dreamweaver, if you scroll on down to you the bottom of the page. I'm at line 62.
01:21First of all, let's take a look at that bulleted list.
01:24As you saw, those are displayed right now with individual bullets, if I wished. I don't have
01:30to display the bullets at all by taking this ul and adding a class of unstyled, and
01:38by adding that class of unstyled that will get rid of the bullets in the list.
01:43So now if I refresh my web page, you see there is my list here under Exhibit Halls A & B,
01:51and the bullets on that list no longer exist.
01:52Now I don't think that works at all. I liked it much better as a bulleted list. I thought
01:56it was much easier to read that way; however, I wanted to be sure to tell you about unstyled,
02:01which is a class that you can use on both ordered lists, the ol tag and unordered lists, which is the ul tag.
02:08You, of course, could then layer other styling on top of your list once you've turned the
02:11bullets off via the unstyled tag.
02:14Also note that it's gotten rid of the margin or the padding that goes around that list as well.
02:18So that's a pretty handy style to know about.
02:20I'm not going to use it on this page, but now you know that it exists.
02:24Okay, so back to Dreamweaver here. I'm going to take that class of unstyled out again.
02:29And then down here at the bottom is that group of photographers and their specialties.
02:34So let's go ahead and mark this up correctly.
02:37So any time you see something like this, you want to make use of a definition list, you
02:41always knew to start with the dl tag, which stands for Definition List.
02:47And then down underneath the end of that, we're going to wrap that, so of course that /dl is required.
02:53Then we're going to have our first one here, Sam Gilmore.
02:56We'll change this paragraph tag to a dt, which stands for Definition Term.
03:02And Ocean photography we'll change to a dd which is the actual definition.
03:08And although we're not thinking of these as dictionary terms with definitions, these are
03:13again related pieces of content that are tied together, and by using dt and dd we are showing
03:20the association between those two items.
03:23So we are going to ahead and change this markup here really quickly.
03:26Okay, so now I've got this all marked up as a definition list.
03:32So if I save this again, File > Save, and I put it into Firefox, you'll notice that
03:38we have a very nice style here, where we have the Sam Gilmore presented as a bold name and
03:43then underneath of it Ocean photography is slightly indented.
03:47So it's pretty clear that Ocean photography goes with Sam Gilmore, for example.
03:51So that's a very nice looking list.
03:54There is another style that Bootstrap offers that you may want to make use of here as well.
03:59So if you go back to Dreamweaver, add here for the dl, simply add the class of dl-horizontal.
04:11And what that will do, as you might predict, will put the name over on the left and the
04:16occupation or interest over on the right.
04:20So if you save this page and put it into Firefox, Refresh, you'll see down here at the bottom
04:27of the page now that we have a list of photographers, they're still bold in with their interests
04:32over on the right side, which is also a very, very nice presentation.
04:36So Bootstrap has a few treatments for lists. These are lists that are just your basic list,
04:42content list that I've showed here on the web page.
04:44There are additional options that are available for navigation, which is often marked up as a list.
04:48I'll be covering those in the next chapter on navigation.
Collapse this transcript
Styling buttons
00:00You might have noticed the learn more link next to the session names here on this program.
00:04They aren't styled really nicely. It would be so much better if they looked more interesting
00:09and certainly more compelling to click on them.
00:12Fortunately, Bootstrap comes with a number of styles that will make those links more interesting.
00:16In fact, we can make all of those links look exactly like buttons if we wanted to.
00:21So I'm going to go ahead and apply some treatments to these learn more links to make them look
00:25more interesting, more clickable, pop-off the page a little bit more than they do right now.
00:30So if you go to Dreamweaver and scroll on down to the first instance of these learn
00:35mores, which I think is around line 24, Art in Unexpected Places,
00:40you'll see that we have here the a tag with a learn more link inside of it.
00:44There are a number of things that we can do to give this a treatment.
00:47So one thing that we could do is simply use that small tag which I covered in a previous
00:53video, and you can wrap the small tag around the link itself, and if I just save that,
00:59Ctrl+S or Command+S to Save, and Refresh this inside of Firefox, you'll see that I've now
01:05made the text slightly smaller next to the names, which is good.
01:09It doesn't look like it's competing with the name of the session anymore as it did before.
01:14If you take a look at Art in Full Bloom, it looks like it's Art in Full Bloom learn more
01:18as opposed to Art in Full Bloom, learn more.
01:20So this is pretty good, but we can make it a lot better using Bootstrap's button classes.
01:26So I'm going to go back into Dreamweaver, and I'm going to pull that small tag out.
01:34And instead, I'm going to go ahead and apply some classes.
01:38So at the most basic if we apply a class inside of the href tag here, you set a class of
01:46btn for button, and save that and take a look at it in Firefox, Refresh one more time.
01:53You'll see that the learn more link here actually looks like a button.
01:57It's squared, it has rounded corners, it has the word learn more in it.
02:00When I roll my mouse over it, it looks like the button is slightly depressing.
02:04So that I think is definitely an improvement over what we have for the other learn more
02:09links here on the page right now.
02:10One of the other things you might be interested in doing is adding some kind of color to it.
02:15Those are available to you as well.
02:17Back to Dreamweaver here, as an additional class that we can add on here, there is btn-primary,
02:26that will make this button a blue color, sort of the primary styling for buttons on a Bootstrap web page.
02:32So if I go ahead and Save that, and I Refresh this inside of Firefox, you will see that the button becomes blue.
02:38We've seen this before, we did this in the Hero unit, and when you roll over it, you'll
02:42see that the color does change a little bit, but we have a few more options.
02:47So if I scroll on down the page, the next instance of this, and I give this a class
02:52of btn and btn-info, this is going to make a light blue button.
03:01And I can keep on going down the page. There's a number of these, so let's just go ahead
03:05and put them all in, class for the next one, remember to put in btn for the generic buttons
03:11styling and then the second class will apply a color to it.
03:15So btn-success will give you a green button.
03:23Here at the next link, btn btn-warning will give you a yellow button.
03:34Down here, btn btn-danger will give you a red button, class= that does help.
03:46And then one more down here, class="btn btn-inverse" which will give you a black button.
03:55So I'm going to go ahead and Save this, and we can put it in Firefox and Refresh, and
04:01we'll have multicolored buttons, so you can see all the different color buttons that you
04:05have here that all ship with Bootstrap.
04:07Now notice the names of the classes that I gave you for these button-primary, button-info,
04:12button-success, button-warning, button-danger, and button-inverse.
04:15None of these are tied to a color name, and that's done very deliberately so that you
04:19can override these colors with your own colors.
04:23So you can think about these buttons in terms of their functionality, the primary button,
04:27treatment that you're going to have, an informational button, a button indicating success, a button
04:32indicating a warning, and so forth.
04:34That is why these names exist, and that's why there are so many of them inside of Bootstrap.
04:39One final thing we can do with our buttons is we can change their size.
04:43So back to Dreamweaver again here for a moment, and I'm going to go back on up to the top
04:47page, back to line 24 where we have our first button.
04:52There are different sizes of buttons that come with Bootstrap.
04:56We've been seeing the default size here, so there are three other sizes that are available.
05:00So I'll go ahead and show those to you as well.
05:02If as a third class you add to this tag, btn-large, you'll make a large button.
05:10We did that with the Hero treatment in the previous video.
05:14Or if the next one here, if you say btn-small will make a smaller button, and we can go
05:21even smaller down here with the success button, btn-mini, which will make a very small button.
05:30So once again, go ahead and save this, take a look at it in Firefox, and you'll see we
05:36have a large button, we have a small button. You can compare that with this yellow button
05:40down here at the bottom, which is the standard size.
05:43So we have a small button, and we have a mini button.
05:46So you're welcome to go ahead and try out those particular classes and see what you
05:51can do here in the web page.
05:52I recommend not overriding any of these colors just yet. I'm sure you're more than capable
05:56of doing that in the CSS, but I have a way that I'd like for you to do that.
06:01And just wait a couple more videos, and I will cover how to override the core CSS with your own.
Collapse this transcript
Incorporating images
00:00So this page is looking better than when we started, but it's still lacking in a lot of
00:04color and a lot of interest, and one of the things that we could do to make page more
00:09interesting and break up the text a little bit, of course, would be to add a few images.
00:13But in addition to that, I'd like to tell you about some great image treatments that
00:17ship with Bootstrap that are really fun. You can take a square image and apply a style to that.
00:22We will make it appear round on your web page.
00:25There is a treatment that will give you rounded corners on the images, and there is also something
00:30called the Polaroid treatment, it will put a gray line around your image, as well as a white border.
00:35So, there are some images inside your exercise files, so make sure you go ahead and copy
00:39those into your Bootstrap site, and we're going to hop in Dreamweaver here, we'll go
00:45ahead and add those images.
00:47So the first place I'm going to add an image is right here after Art in Full Color.
00:51In fact, right inside this paragraph here, describing Art in Full Color, I'm going to
00:56go ahead and add my image tag, so image source equals, and as always we can browse for that.
01:05I'm going to pick the flower here from your images folder and say OK.
01:11These are just sort of decorative pictures, so I'm just going to give them an empty alt tag.
01:15It's not really important that people with disabilities are able to see these pictures,
01:19you can certainly put in a description for them if you wish.
01:21Then I'm going to scroll on down the page here, and I'm going to insert another picture.
01:27Let's scroll on down to right here, Tuesday, March 6, just before the strong tag here, between
01:36the paragraph, I want to go ahead and insert another image file.
01:41And once again, we can browse for the image and here I am going to put in the picture of this artist.
01:51And once again, I'm just going to leave a blank alt tag, we should always include that alt tag, though.
01:58And then finally, I'm going to scroll in down the page here to just before Exhibits A & B,
02:03so this is around line 60.
02:05I'm going to go ahead and add an image tag right here inside of this paragraph, and this
02:14particular image that I'm going to put in is the picture of the road, and once again, a blank alt tag.
02:23Okay, so I've just added three images to my document, if I go ahead and say File > Save,
02:29and I pop in to Firefox and I take a look at my page and I Refresh, you'll see that
02:33I have these pictures, so here's my picture of the flower, down here is a picture my artist,
02:39and down here at the very bottom is the picture of the road, and it looks a little bit chunky
02:42and blocky, so I'm going to add some additional styles to these to give them those treatments that I discussed.
02:48Let's switch back to Dreamweaver and scroll back on up the page here to the flower image,
02:55and I'm going to add some classes do this.
02:57So the big class I'm going to add to this is image, img-circle, which will give us a
03:06treatment of a circular image.
03:08So if you just do that much and save your page and take a look at it in Firefox, you'll
03:15see that, lo and behold, your squared-off image has now become a circle, and it looks great.
03:20I am now also going to float this on over to the right side of the page. I don't think
03:24it really works over here on the left side.
03:27So, inside of Dreamweaver, I'm going to add a second class, it's our old friend pull-right,
03:34which will float the image over to the right side of the page.
03:37So we'll go ahead and save that again, take a look at it in Firefox, and you'll see we
03:42have a nice round image over here pushed to the right side of the page, looks a lot better.
03:48So that's one of the treatments that's available to you in Bootstrap image, img-circle will
03:54give you the circular images.
03:56Now if we go back to Dreamweaver again, and we scroll on down the page, back to our second
04:01image here with the image of the artist, I'm going to go ahead and add another class, and
04:08I'm going to give this a class of img-rounded, which will give it rounded corners, and in
04:15addition to that I'm also going to do the same thing again, I'm going to do a pull-right
04:19to make it float to the right side of the page.
04:23Save this again, and if you refresh it here inside of Firefox, you'll see that we have
04:29our image of our artist over here floating out to the right side of the page.
04:32You'll see that the image corners on this are also rounded, which is a nice treatment.
04:37Last, we're going to give this road picture down here a treatment, so scroll on down in
04:42your document to the road picture, and for this one we'll go ahead and add a class for it,
04:46and the class is img-polaroid, and once again, I'll add a pull-right to that particular
04:57class and go ahead and Save that, and we'll Refresh that inside of Firefox, and you'll
05:04see that we now have our image of the road over here on the right side of the page.
05:08You see that we have a nice gray border going around that with some white in between.
05:12If I had a different color background, that white in between the light gray line and the
05:17picture would stay white, which explains the name Polaroid.
05:21So there we go, three image treatments here inside of Bootstrap.
05:25You can make use of these very, very simply with a single class, the Polaroid treatment,
05:29the Rounded corner treatment, and of course, the Circle treatment up here on the top.
Collapse this transcript
Incorporating icons
00:00Bootstrap also comes with a full set of icons that have been contributed by glyph icons.
00:05To get a full listing of these icons, if you go to getbootstrap.com, click on the link
00:10on the top for Base CSS and then click on the link on the left side for icons by Glyphicons,
00:16you'll see that you have a whole list of these, 140 choices of all different shapes and sizes
00:23and indications of things.
00:24I'm going to grab this calendar icon right here, I'm just going to highlight the words
00:28icon-calendar and Ctrl+C or Command+C to copy that.
00:32I'm going to incorporate that into my web page by putting this little icon in front of the date.
00:38So, what I'm going to do now is I'm going to hop into Dreamweaver, and I'm going to
00:44scroll on down here to the first instance of where this happens, which is here, at 9:30
00:50to 10:30am: Elizabeth Hall, and that's where I'd like to go ahead and put this particular icon.
00:57The way you go about doing this is you're just going to put in a span tag with a class
01:02of whatever class is associated with that particular icon, and those are all displayed
01:08there on the web page.
01:10And then you're going to follow that immediately by a slash span, so you see here the span
01:14class icon-calendar is the name of the class which we saw right here on the web pages.
01:21Those are all of the names of the classes to get those particular icons to display.
01:26Then go ahead and save--Ctrl+S or Command+S to Save--and if you put this page into Firefox,
01:34you'll see here that our icon shows up right here on the page in front of the time.
01:38So that's a nice little feature that Bootstrap ships with. But what if you don't want black?
01:42What if you want white instead?
01:45That is possible to do as well, as you'll see here inside the documentation down here
01:50at the bottom of the page, it will indicate that you can go ahead and use icon-white,
01:57which will give you the icon as well, but in the white format instead of in the dark format.
02:03So, now if I scroll on down to the next instance here, I'm going to go ahead and put in that
02:08span tag again of icon-calendar icon-white which will give me a white version of the
02:19icon followed by a slash span.
02:21Once again, go ahead and Save this and go ahead and refresh Firefox, and you'll see
02:28the icon is there. It's very hard to see, of course, a white icon on a white background,
02:32but you can kind of see it a little bit, because the edges of the icon have been treated to
02:37blend into a dark background.
02:38So, that's the way that you would go about incorporating icons into your document.
02:43You can go ahead and repeat this process for the rest of the page to continue incorporating
02:47icons as many as you like.
02:50Where these icons are being pulled from is inside of your file structure within Dreamweaver.
02:56Inside of your image folder, you'll notice that there are a couple of these images here,
03:00glyphicons-halflings and a white version of those.
03:05In fact, what you have here is an image sprite, so there are 140 tiny little pictures that
03:10occur in one PNG, which is a really great way of handling these tiny images for mobile phones.
03:16Rather than having to pull down 140 individual images, in this particular case, we've only
03:21pulled down a single image and then using CSS, we target the picture that we want directly
03:28on that image, so that is where those are located.
03:32The drawback to doing it this way is that since these are image sprites and they're rasterized
03:37small images, you're not able to blow these up and use them as large-format pictures within your document.
03:43You certainly could download those kind of graphics elsewhere on the Internet and incorporate
03:47those into your Bootstrap site, but these glyph icons that ship with Bootstrap, they
03:52are image sprites, and that's the way that they work.
Collapse this transcript
Overriding Bootstrap core CSS
00:00Finally, the video you all have been waiting for: how do you override the core CSS in Bootstrap?
00:05Well, there are two possible ways that you can do this.
00:08I am on the getbootstrap.com website, and I've clicked on the Customize link, and this
00:15is the page where you can customize Bootstrap to do exactly what you need it to do and nothing more.
00:20So, you can choose exactly which components you want to include. We talked a little bit
00:25about the Scaffolding, much of the rest of this we haven't talked about yet, but these
00:30are JavaScript-driven widgets that I'm going to cover in a couple of videos, some of the
00:34styling that's in CSS you can choose to include it or not, you can choose to include specific
00:40plug-ins that we rely on jQuery, you can customize these variables.
00:45Bootstrap makes use of the less framework, and you can type in different values for these things.
00:49So the easiest one to understand is here under Colors.
00:52So what exact shade of blue would you like to have where blue occurs inside of your document,
00:58what exact shade of green and so forth?
01:00So you can customize all these variables and type in your own values and then customize
01:05here and download by clicking on the big honking button at the bottom of the page that will
01:10download exactly what it is that you want to have for your website.
01:15However, there are some major downsides to customizing your Bootstrap Installation this
01:21way, particularly where the CSS is concerned.
01:24First of all, in the course of preparing for this video, Bootstrap released two new versions.
01:29I started working with Bootstrap 2.0.4, and just yesterday 2.1.1 was released, so
01:36obviously these new releases are happening all the time.
01:39If you want to update your website to the latest version of Bootstrap, right now what
01:43you would do is simply download the latest version, replace the existing CSS and JavaScript
01:49files with the new versions that you would download from the Bootstrap site, which is
01:54great until you realize that any customization that you've done to bootstrap.css or bootstrap-responsive.css
02:03will instantly be lost, because you'll overwrite those files with the new ones that you've downloaded.
02:08So you'll either need to now as part of that process keep track of where all those customizations
02:13are and retype them in here on the screen, or you'll have to keep track of what they
02:17are and re-enter them when you upgrade your version of Bootstrap, and that's just too
02:23much work for me. I can't remember what I've changed and what I haven't changed.
02:27So, I think a far better approach is to create a custom stylesheet and put any changes that
02:33you're going to include there.
02:35Anything you're going to override or any additional styling that you're going to include, put
02:39it all in that stylesheet, and that will make your website so much more maintainable.
02:46It'll be so easy to upgrade the latest version of Bootstrap, because then you'll just copy those
02:50new files in over the old files and your customizations are all still intact.
02:55So, let me show you how to do that process now.
02:58Back here in Dreamweaver, I'm going to go ahead and I'm going to create a new document,
03:02so File > New, and this time it's going to be a stylesheet.
03:06So I'm going to pick Stylesheet from my Page Types over here and say Create, and it's going
03:11to create a blank stylesheet document for me.
03:14Because this is just a proof of concept thing, I'm going to make a really quick change here.
03:19I am going to go ahead and change the body background color to a lovely shade of green,
03:26so I'm going to say background-color is bada66, and I'm going to go ahead and save that, File > Save.
03:37So I'm going to go to Desktop, to my Bootstrap folder, to my CSS folder, and I'm going to
03:44save this as custom.css, so that is my custom stylesheet.
03:50Now the next thing I have to do is attach it to the document I have been working on,
03:54so here's my schedule.html, which is the document I've been working on in this chapter.
03:59I'm going to click here just after the style sheet for bootstrap-responsive, and I'm going
04:05to insert my stylesheet here.
04:08So, over here on the right side of the screen, if you click on the Link icon here inside
04:13of the CSS Styles palette and you choose the Custom Style Sheet here from the list,
04:20go ahead and say OK. It'll go ahead and write in the code to include your custom style sheet
04:25right here inside of your document.
04:27Again, you want it to occur last in the string of style sheets, because remember, anything
04:32that you put in your custom style sheet you're going to want to override what comes before
04:36it, and so if you put this custom.css stylesheet somewhere further up the line, closer to the
04:41title tag in the code that I'm working with here, it may not necessarily override the
04:46default styling from Bootstrap.
04:48Okay, once you've got that in place, File > Save, we can go ahead and take a look at
04:53this in Firefox, and if I Refresh the page that I'm working on, you can now see that
04:58we have a lovely shade of green behind our text here, and the icons that we put it in,
05:04in the previous lesson you can see that we have a nice dark icon, we also have a white
05:09icon, we have some white here associated with our block quote, and if we scroll on down the
05:14page a little farther, this image here that had that class applied to it, image-polaroid,
05:20you can see that it has a nice white stripe around in addition to that thin light gray
05:23stripe that goes around it as well.
05:26So that is how you add custom styles to your document.
05:30Make sure you put them in a separate style sheet, call it whatever you like, I usually
05:34call mine custom.css because it's pretty clear what that is, and then make sure you
05:39link it to your document after any other style declarations that are on your page so that
05:43it'll override things correctly.
Collapse this transcript
4. Navigation Systems
Adding breadcrumbs
00:00The next aspect of the Bootstrap framework that I will examine includes the various methods
00:05of creating navigation systems.
00:07Bootstrap offers many different widgets for doing this, including tabs, pills, buttons,
00:13dropdowns, lists, and full navigation bars, as well as helper systems like Breadcrumbs and Pagination.
00:20As you'll see in the next chapter, these systems can be combined with JavaScript to include
00:25dropdowns in many cases.
00:27But for now, I'd like to start with taking a look at Breadcrumbs.
00:31A breadcrumb is a trail of links that you might see at the top of a web page that indicates
00:36where you are in the website's hierarchy.
00:38For example, if you're at lynda.com and you're taking a look at my author page, you'll see
00:44that the breadcrumb is located up here at the very top of the web page just under the Navigation Bar.
00:50This indicates that you're on the page talking about Jen Kramer, and to get there you had
00:55gone through the author's page, which would list all of the authors on the website.
01:00And before that you were at, in this case, lynda.com's homepage.
01:04We can create this exact same navigation system inside of Bootstrap.
01:09Bootstrap comes with a system for styling breadcrumbs, and I'd like to take a look at that now.
01:15So if we go back to Dreamweaver, and you open up the document that's inside of your exercise
01:20files, you will see that this is actually the breadcrumb we just saw in lynda.com but
01:25without any styling applied to it.
01:27If I view this in my web browser right now, you'll see that it's just a bulleted list
01:32with some links included and some of the LIs, as well as a separator which is that little double-angle bracket.
01:41So now we need to add a little bit of styling to this and a little bit of extra markup
01:45to make this a breadcrumb.
01:47So, first of all, since we have this displayed on a web page, we can certainly incorporate
01:52the grid system into laying this out.
01:55If you choose to do that anywhere along the way in these examples, what you would do is,
02:00of course, you'd start with a div with a class of container-fluid as we've done before.
02:09And don't forget to close that div.
02:12And you can follow that with the call to your row-fluid.
02:17So we're going incorporate our div with a class of row-fluid, and don't forget to close that div.
02:29And then the last part of this would be what's inside of that row.
02:32At this point we usually incorporate some kind of tag that would have the span class
02:37inside of it, that would indicate how many rows this particular aspect of the website
02:41will span, and I'd like this to span to all 12 columns.
02:45The question is what kind of markups should we use to do that?
02:48And I've done a little bit of research about this in the community online, and there is
02:53a little bit of debate about what the best kind of markup is for breadcrumb.
02:58So my feeling on it is that the best tag to use is the nav tag, because breadcrumbs are
03:03a form of navigation.
03:05Some people disagree with this and say that the nav tag should be used only in cases of
03:09major navigation elements, like the main navigation on a web page.
03:13So, what my argument would be is I am going to use the nav tag to mark up elements on
03:18my web page that are related to navigation.
03:20So I am going to go ahead and use the nav tag here to indicate this is where my breadcrumb is going to be.
03:26So, I'm going to put in a nav with a class of span12 because I'd like this to go stretch
03:33all the way across the page.
03:35And of course, I am going to close that down here.
03:40And let me put in a couple of tabs here just so that this code is a little bit easier to
03:45read, and one, two, three over for the ul, and four over for each of the LIs. Okay.
04:00So now that we've got that setup, actually we've done very little with what we've incorporated here at this point.
04:06All we've done is incorporate some additional markup with a bulleted list, and this is not
04:12any particular special bulleted list at this point in time. It's just a bulleted list.
04:16So, if we just save this page right now and we take a look at it again inside of Firefox,
04:20you will see that actually nothing has really changed too much.
04:24You might have seen it twitched a little bit over from the left column, that has to do
04:27with the grid system and its spacing and margins and so forth. All right!
04:31So now let's add the actual markup that makes this a breadcrumb inside of Bootstrap.
04:36So the fastest and simplest way to do that is right here inside of the ul tag.
04:41We're going to add a class, and this will be a class of breadcrumb, breadcrumb singular,
04:48that would be the part that I would miss and call it breadcrumbs, plural.
04:51But it is breadcrumb, singular, inside of the code.
04:54The second thing that we're going to add to make this a breadcrumb is we're going to indicate
04:59which item is active.
05:00So on the lynda.com example, we were on the Jen Kramer Author page.
05:05So Jen Kramer would be the active aspect of the breadcrumb indicating where you are.
05:10Active is a class that is used all over Bootstrap to indicate where you are.
05:15You will see it used many times in this navigation chapter.
05:19So, I am going to add a class right here on this li of active, and that will indicate
05:26where we are in the hierarchy.
05:28And the last thing that I'm going to do is specify these particular little spacers, and
05:34we can do that right here in front of these little double-arrow guys.
05:39We'll add a span with a class of divider, and close that with a /span, and we'll apply
05:50that to the second divider as well, along with the /span.
05:57And so that indicates that the little character that I am using here, which is this double arrow,
06:03would be what's going to separate my breadcrumb. You, of course, could use any character that
06:07you like in that process.
06:09So I am going to go ahead and save this, Ctrl or Command+S to Save, and let's take a look
06:13at it again in Firefox.
06:13You will notice that this looks pretty radically different.
06:16Now, we have a nice-looking breadcrumb, it's shaded black just slightly, and it has very nice spacing to it.
06:22You can see that the character in between is nicely styled as well, screen blacked just
06:27a little bit so that you can see that there's a separator, but it's not dominating the look
06:31of this particular breadcrumb.
06:33There is another treatment that we could give to this if we wished.
06:36In one of the previous videos, I talked about the glyphicons that come with Bootstrap, and
06:43we could incorporate one of those as our divider if we wished.
06:46So, what we would do if we chose to change out these little characters instead for an
06:53icon is right here inside of the class where it says divider, go ahead and just add icon-arrow-right, for example.
07:05And that will give as a little arrow icon instead of the HTML character that I am using here.
07:10Of course, you will need to get rid of the HTML character, if you choose to do that.
07:13So I am going to leave the other one the way we had it set up so that you have an example of each treatment.
07:20And I'm going to go ahead and save that again, and we'll take a look at it inside of Firefox, Refresh the page.
07:26So you see here I have my icon now that's separating the items in my breadcrumb.
07:32And remember, of course, this is a dark icon. If you prefer to use the white, remember just
07:38like we saw in the glyphicon video, you can say icon-white and that will load the inverse image.
07:47So just to see that in action, we'll go ahead and Refresh the page.
07:51So you can see that, that is the inverse, the lighter color icon.
07:55Of course, it actually looks better dark. It's pretty hard to see that white arrow there.
07:59But if you had played around with styling here and you changed some of the colors,
08:03white might be a better choice.
08:04So I am going to go hop back into Dreamweaver and take out that icon-white aspect and save this.
08:12So, now you've seen how to incorporate a breadcrumb into your web page.
08:17It's very simple. We just add a few classes to style up our breadcrumb.
08:21You can use all kinds of different HTML characters as separators in between the navigational
08:26elements inside of your breadcrumb, or of course, you could use one of the glyphicons
08:31that ships with Bootstrap.
Collapse this transcript
Adding pagination for paging through content
00:00Occasionally at the bottom of the page, there are many blogposts.
00:03A page with Search Results or a page of many products, you'll see a list of additional
00:08pages listed at the bottom. Think about the bottom of the Google Search Results page.
00:13Here I am on Google, if I do a Search for lynda.com, you'll see that I get a list of
00:20all kinds of stuff here that pertains to lynda.com, and then down here at the bottom, I have this
00:26long Goooooogle at the bottom which has a series of numbers plus the Next button.
00:31If I go to the Next page of results and I scroll down to the bottom, again, I have a
00:36Previous and Next button down here, as well as the numbers.
00:39This is Pagination, specifically the numbers that are there in the middle as far as Bootstrap is concerned.
00:45The Next and Previous buttons are treated slightly differently, they're called Pager,
00:50and I am going to cover those in the next video.
00:52So let's take a look at how we might style something like those numbers down at the bottom
00:56of the screen in our Google Search Results.
00:59So here inside of Dreamweaver, I have a bulleted list, it's wrapped inside a <nav> because
01:06of course, this is navigation that's there on the web page.
01:11And if we just take a look at this right now inside of Firefox, you would not see a whole
01:16lot that was terribly interesting. It's a bulleted list with some numbers and some characters
01:21that point you in either direction.
01:23So how we can make this look a little bit more interesting?
01:25Well, of course, Bootstrap has some styles for dealing with something like this.
01:30So if we go to <nav> and we add here a class of pagination, that would be a great way to start by making
01:38our numbers go horizontally on the page.
01:41I'll just go ahead and Save that and preview that inside of Firefox. You'll see that I have
01:47a series of numbers that are now in boxes stretched out here on the page.
01:52Now if you noticed on the Google Results Page, we landed on one of the pages, and there was
01:57an indication of which page we are on.
01:59If we were on Page 1, for example, there would be nothing before that, so the number 1 might
02:04be grayed out and so might the double caret on the left side of this Pagination, and Bootstrap
02:10has a way of doing that as well.
02:12So in Dreamweaver, if I add to this first <li here a class of disabled, in other words,
02:21gray this out, because there is nothing that comes before the Search Results, and here
02:27for the number 1, if I add a class of active, in another words, this is the current page
02:33of results, there will be an indication that I am on page 1, and there's nothing before this.
02:38So once again, if I Save this and I Refresh this in Firefox, you'll see that it looks
02:44like my double caret here is grayed out, and when I run my mouse over it, looks like it's
02:50no longer clickable, likewise here for the number 1.
02:54Now having just said that, it is true that it looks like the double caret and the number 1
02:59are not clickable, and the ui would indicate that they're not clickable.
03:04CSS has been used to change the cursor here to make sure that it doesn't look like a finger,
03:10the way it does if I roll over number 2.
03:12However, most assuredly the number 1 and the double caret are still very much clickable items.
03:18If you want to make sure that they're truly disabled, you are going to have to do that
03:22with some kind of JavaScript magic or maybe you've hooked this up to a content management
03:27system or some kind of programming language, which will spit this back so the links aren't
03:32actually there at all.
03:34So be careful about that. Just because you use class of disabled doesn't necessarily
03:39mean that there's no link that exists on a item anymore, because if you take a look at
03:43the HTML, there is most certainly a link that appears there, and it is still clickable,
03:48even though it doesn't look like it.
03:50So one final thing I want to show you. You designers are probably wondering how you can
03:55make your pagination centered on the page. You are probably thinking about doing that
03:58with a custom style. There's no need to do that. Bootstrap does ship with the ability
04:02to center the pagination on the page.
04:05What you need to do here is inside of the nav class of pagination, add the class of pagination-centered,
04:14and if you Save that and Refresh that inside of Firefox, you'll see that now your pagination
04:19centered on the page.
04:21The option also exists for right-aligned pagination. If you change this to pagination-right, you
04:29can make right-aligned pagination as well.
04:32So that's the story behind pagination and treatments for it. Remember, pagination usually
04:37comes out of a content management system or some kind of database-driven application at
04:42the bottom of a web page for tapping through things.
04:45I am showing you examples here inside of Dreamweaver, so if you were to use this kind of pagination
04:50in your websites, you would of course need to hand code all of these links to separate
04:55HTML documents. It takes a lot of time.
04:58Pagination is really a widget that's best linked to something that has a database behind
05:03it where the pagination is generated out of the database.
05:08So it's not likely it's something that you would use on just a static HTML website.
05:12You're most likely going to see it used more often in something with the database behind
05:16it, like a content management system.
Collapse this transcript
Adding a page for next and previous links
00:00I'm here on the lynda.com blog at blog.lynda.com.
00:05And one of the navigation elements that the lynda.com blog uses is down here at the very
00:10bottom of the web page.
00:11So if you scroll all the way down to the bottom of the blog, you'll notice down here in the
00:16bottom there is this little link that says Older Entries.
00:19This is a very common type of navigation that you see in blogs, so if I click this link
00:23that says Older Entries, and I go all the way down to the bottom of the page, again,
00:29you'll notice that it now it says Older Entries and Newer Entries.
00:33This type of navigation lets you page basically back and forth between parts of this blog
00:39just by clicking these links.
00:41We can go back a page in time or go forward a page in time.
00:44This is called Pager inside of Bootstrap, so a Pager allows you to style these links
00:49for next and previous or older and newer that you see at the bottom of these pages.
00:55So if you hop on into Dreamweaver, you'll notice that I've given you some really simple
01:01markup, this is just a two-bullet list.
01:04Just a ul with the two bullets that say Previous and Next. Styling this is just as
01:09easy, so we're going to start by adding up here on the top a class of pager inside of the ul tag.
01:19And that will take care of the styling for our Previous and Next buttons with Bootstraps defaults.
01:25If you just go ahead and save that document, and we preview it inside of Firefox, you'll
01:31see now that we have two links, Previous and Next, I can roll over them, you can see that
01:35they have a very nice hover state as well. So that's great!
01:39You may be wondering, what if I want to space these out so that they're at the edges of
01:44whatever area I've included these particular buttons in?
01:47So, for example, at the bottom of the lynda.com blog we've pushed Older and Newer Entries
01:53to the very edges of the blog here.
01:55What if I want to push these two buttons apart as well?
01:58Well, that's completely possible.
02:00If you hop back into Dreamweaver again, we're going to add two classes.
02:04The first li for Previous, we're going to add a class of previous.
02:10And for the next button labeled Next, I'm sure it'll be shock to learn we add a class of Next.
02:19So just by doing that, this will push these two buttons to the edges of the web page,
02:24and Previous would indicate the side where you want it to say older or further back
02:27in time, the left side of the page, and the one where it says Next, you want to push to
02:31the right side of the page, or going into the future.
02:35So if we Refresh our web page, here we go.
02:39Now you see that I've pushed these all the way to the edges of the page.
02:42Because I don't have any of the Scaffolding included inside of this HTML document, these
02:47are pushed all the way to the edges of the window.
02:50Of course, these will be pushed to the edges of its containing element if you had some additional markup here.
02:56So if you have these in the bottom of some kind of div, let's say with a span of four,
03:00it will be pushed to the edges of that.
03:02In other words, about a third of the screen width, instead of the entire screen width, as you see here.
03:07So that's great, but what if there are no previous entries?
03:12What if I would like to have that Previous button sort of grayed out?
03:15Just as we've seen before in the last video, you can add a class of disabled, disabled
03:21will gray this button out.
03:22So if you go ahead and Save that one more time, Refresh your web page, you'll see now
03:27that the previous button is grayed out, there's no hover state, and the arrow stays when I
03:32roll my mouse over it, implying that this is not a clickable button.
03:36But just as I pointed out in the previous video, it most assuredly is a clickable button.
03:41We've used CSS here to make it look like it's not.
03:45So if you really truly don't want this button to be clickable, you're going to have to find
03:48some way of getting rid of that link or using more JavaScript tricks or using some kind
03:52of programming language to make this truly a not clickable button.
03:56The next button, of course, still remains clickable.
03:59All right, so this is some very simple markup here for including Next and Previous or Older
04:05and Newer buttons inside of your web pages.
04:08If you want to flip forward a page or back in time, they're very commonly used at the bottom of blog entries.
04:13And you can combine this with a couple of classes to give this some nice styling and some great functionality.
Collapse this transcript
Using tabs and pills navigation
00:00Over the next few videos, we're going to take a look at the simple bulleted list here and a number
00:05of different ways that we can change the classes to make this list look very, very different inside of Bootstrap.
00:11So, right now I'm taking a look at pills here. We're going to take a look at pills and tabs.
00:15Tabs you're probably familiar with, and pills are sort of round, oval sort of shapes.
00:21They have curved edges that you can also use to make very interesting looking navigation bars.
00:28What we have right now is our default markup, though, isn't terribly interesting.
00:32If I very quickly look at this inside of Firefox, you'll see that what you got is your basic
00:38bulleted list, very functional, not terribly pretty.
00:42So let's start adding some classes to see how we can make this look a little bit more
00:46attractive or a little bit different.
00:48So inside of Dreamweaver, the very first step is to add a class of nav. This is the most basic markup.
00:55Just by adding this nav you've indicated that this is navigation and some
01:01basic things are going to happen here.
01:03So when I refresh you'll see that the margin and padding associated with ul has gone away,
01:09you'll see that the bullets have gone away, and we're now crammed into the side of the web page.
01:13The reason we're crammed into the side of the web page is because I'm not making use
01:16of the Bootstrap's Scaffolding system at this point. I've kept my markup very, very simple,
01:21the nav tag is located inside of the body tag, it's being pushed all the way out to
01:26the very edges of the web page.
01:28If I had this nav tag located somewhere else inside of the Bootstrap Scaffolding, this
01:34navigation would not look like it's a crammed into the edge.
01:37So as you roll your mouse over these, you can see that there's a nice hover state that
01:41goes down these quite lovely.
01:44The reason that that hover state goes all the way across the page is because that's
01:47how wide the containing element for these particular links is.
01:51If you use the Scaffolding system, of course, this could be potentially quite narrower,
01:56depending on which of the span classes you choose to put your navigation list in.
02:01All right, so that's it, very, very basic, the first step of styling.
02:05Now let's add something to make it a little bit more interesting.
02:08If I add nav-tabs, this will of course create more of a very tabbed type of look.
02:16It'll make our links go horizontal instead of vertical as well.
02:20So if I Refresh my page in Firefox, you'll see that that has in fact happened.
02:26We have a series of links here with a line underneath, and everything is looking great, but it doesn't
02:30really look like tabs yet.
02:32And the reason it doesn't look like tabs is because I haven't indicated what page I'm on.
02:37What page is the active page?
02:38There is that active class again, so let's say I'm on The Art page, so if I put in a
02:45class of active right here inside of my li and save that one more time and put that in
02:53Firefox, you'll see that we have a very nice looking tab right here. Of course, I can put
02:59some content underneath of this, and then it would be really obvious where I was.
03:04So, that is tabs, and they're most simple structure. Make sure that you have an active state so
03:10that the tab meme is a little bit more obvious on the page.
03:14Now you might be wondering what else could you do with this type of tab styling?
03:18There is another class that makes things go vertical.
03:22So what would happen if we took this tab styling, and we actually made it go vertical?
03:25Well, it's a little bit surprising.
03:29So after nav tabs, if you add nav-stacked and save that page one more time, Refresh in Firefox,
03:39you'll see that we have a very nice stack of links. Instead, it's a definite step
03:45up from what we had with just the nav class on that ul.
03:48We have a bit more margin, a bit more padding, we have some nice borders going on between
03:52these, we have a great hover state, we still have our active state right here, it looks
03:57like it's grayed out, it looks like you can't click on it, even though you can.
04:00Remember, that's just a trick that the CSS is playing on you.
04:03I've discussed that in the previous two videos, and of course, these links continue to look
04:07like they go all the way across the page because there's no Scaffolding in place.
04:11Hide scaffolding, then you would see these look a bit narrower.
04:14So, what about that pill thing that I mentioned before?
04:17Well, if I go back here into Dreamweaver, I'm going to take out nav-stacked, and I'm
04:23going to change nav-tabs to nav-pills, and if you Save that and Refresh your Firefox
04:31web page, you'll see that the navigation has again gone horizontal and the active page
04:38that we were on has this lovely blue pill surrounding it,
04:41in this case, a blue box with rounded corners, and of course, there is a very nice hover state here as well.
04:47As I hover over these links, you'll see that they have a lovely grayed box also with rounded corners.
04:53You could use custom CSS to change these colors or tweak the way that these are styled.
04:58Just like we saw with the tabs, you can make this pilled structure also go vertical, and
05:04if we hop back in the Dreamweaver again
05:06and add nav-stacked just the same way we did with the tabs and save and look at this in
05:14Firefox again, you'll see that now our navigation has gone horizontal. We still have our current
05:20page clearly marked here with these big blue rounded cornerbacks, and we still have our
05:25hover state in place as well.
05:27This is an introduction to tabs and pills and how we can work with them to give us at
05:33least three or four different unique looks for how our navigation could look on a web page
05:37just with a handful of styles using the Bootstrap framework.
Collapse this transcript
Adding the basic navigation bar
00:00Bootstrap ships with a nav bar that you can use in your web pages.
00:04This nav bar comes with many, many options for customization and styling.
00:08I'm at getbootstrap.com, and if you take a look here at that black navigation bar that
00:13is at the top of the web page, this is the navigation bar that we're going to work on coding next.
00:19So if you take a look at your Dreamweaver document, you'll notice the code looks very
00:24familiar compared to what we just had out in the previous video.
00:29It's a simple navigation bar. You can see that we have a nice bulleted list here.
00:34So this is our starting point, and we're going to go ahead and start adding a few classes
00:39here to make his navigation bar.
00:41With any navigation bar that we make in Bootstrap, the very first step is to set our ul to have
00:47a class of nav, and then second, we're going to need to pick an active link here in our
00:54list, so li will have a class of active, and I'm going to set that on the home link,
01:01so that's step number one.
01:03Step number two is we're going to take this nav tag that I have on the outside of this,
01:08and I'm going to add another class to that as well.
01:10So, I'm going to add the class here of navbar, and we need to add a div that goes around
01:17this as well, which seems to be important to the styling.
01:21So I'm going to add a div with a class of navbar-inner, and of course, don't forget
01:30to close that div down near the bottom.
01:32If we take a look at what we've got so far, just go ahead and save--so Ctrl+S or Command+S
01:38to save--and then let's preview this page in Firefox, you'll see that we have a navigation
01:43bar that will appear across the top of our page, very nice hover states on the links that are here.
01:48The currently occupied page is indicated here with this nice gray box around the word Home,
01:54so everything is looking particularly lovely.
01:57One thing that we are missing is some kind of indication for what website that we are
02:02on, and that is also included in the specification for the navigation bar, so we can add that.
02:09Inside of Dreamweaver just after the div with the class of navbar-inner, we're going to
02:13add a class of brand. You, of course, can make this link anywhere that you like, probably
02:23back to your homepage, and you're going to put in the text that you want to appear as
02:28the identification for the website, so in this case, this will be the Roux Academy Conference /a,
02:35and if we save that again and we take a look at our web page here in Firefox,
02:42you'll see that we have some nice identification, which is clickable, will take me back to the
02:46homepage, would probably be the way that I would code it, and we have a navigation bar that appears here.
02:52Now if I minimize my Firefox browser and I start to pull this in, you'll notice that
02:57the styling here kind of falls apart a little bit. You'll notice that the navigation wraps
03:02onto the next line, apart from the brand, which is nice.
03:06It's degrading somewhat gracefully here, but as I get particularly small, say mobile phone
03:11small, you can see that this is not as pretty as perhaps it could be.
03:15That's because we haven't added responsive aspect to this particular navigation bar
03:19just yet, but I've given you some basic styling for the navigation bar so far.
03:25One last thing that you probably have noticed is that when we took a look at the navigation
03:29bar inside of Bootstrap, it was black, but here inside of my example it's white, and
03:35it's actually perhaps a little bit difficult to see here on the screen with this big white
03:40background next to it, but you can actually make this navigation bar black as well.
03:44So inside of Dreamweaver, up here where we have the nav with the class of navbar, go
03:49ahead and add navbar-inverse, and this will give you the inverted color.
03:58If you Refresh the page again, we now have a black navbar closer to what you saw on that Bootstrap page.
04:04So this is the most basic markup for the navigation bar that ships with Bootstrap.
04:10We've gone through some simple things like setting up the general structure of it, we've
04:14added some branding to it so that we know what website we're on, and we also changed
04:19the color of this to black, so we have a white version and a black version of this particular navigation bar.
04:24Of course, you're more than welcome to override any of these colors or styles with your own,
04:29using a custom style sheet.
Collapse this transcript
5. JavaScript Effects
Understanding how JavaScript works in Bootstrap
00:00Bootstrap ships with a number of jQuery based plug-ins.
00:03jQuery is a JavaScript framework, and Bootstrap has written some effects using this framework.
00:09They include Modal Windows, Dropdowns, Tabs, tool Tips, Alert, Popovers, and Image Carousel, and so much more.
00:18If you're familiar with JavaScript and jQuery, you can modify anything in Bootstrap using the API.
00:24If you're not familiar with JavaScript or jQuery, don't worry, there are many effects
00:29that are created for you which you can put to use immediately. You'll need to carefully
00:34copy some code from the documentation pages into your work.
00:37I'm at getbootstrap.com, and I've clicked on the JavaScript link here at the top of
00:43the page, and on this page, you'll see 13 effects here that use jQuery and have been coded to
00:49work within Bootstrap.
00:51They're all listed over here on the left side of the page.
00:54There are also some items under the components part of the documentation that also require
00:59the use of JavaScript or jQuery in order for them to work.
01:04Be very sure that you're linked to the bootstrap.min.js file, as well as the latest version of jQuery.
01:11The exercise files that I've given you contain links for that at the bottom of the pages
01:15just before the slash body tag.
01:17If you're creating these files on your own, make sure you link to both of these files,
01:22otherwise these JavaScript effects are not going to work.
01:25Remember that the .min files contain the same information as the regular JavaScript files,
01:31but the min files have the spaces removed to make the file sizes smaller.
01:35There's a few custom HTML5 attributes you should be familiar with that are going to
01:39be used in Bootstrap, and you'll see that in many places over the next few videos.
01:44If you click on the link here for Navbar under Components, and we're going to scroll on down
01:49here to the section that talks about the Responsive navbar.
01:54Right here on line 6 you'll see these two items working together.
01:58The data-toggle is applied to a button or a link, basically anything that has to be
02:03clicked or rolled over to trigger an event or to make something happen.
02:07The data-target is something that takes the action from the controlling element.
02:12So, in the case of tabs that change content when they're clicked, the data-toggle is the
02:17link on the tabs, while the data-target is a div containing the text that should display
02:22when a tab is clicked.
02:23So, I'm going to go through a number of these things in detail now with Bootstrap and JavaScript
02:30so that you can see how these data-toggles and data-targets work, and you can get familiar
02:36with some of the basic JavaScript inside of Bootstrap.
Collapse this transcript
Making the nav bar responsive with JavaScript
00:00In the last chapter of this course, we created this navigation bar for our website.
00:05And it looks great while it's running here on a Desktop and my browser is
00:10maximized, but as I reduce the size of my web browser, this navigation bar wraps
00:17on to another line, which is fine for a little while, but when we get down to a
00:22browser size that would simulate a mobile phone size, you'll see here that the
00:25navigation bar can get quite long and fat, and that's probably not really an
00:30effect that you'd like to have.
00:32It's possible to add some JavaScript to this to make the navigation bar a
00:36bit more responsive.
00:38It's not the only approach to making a navigation bar more responsive, many would argue.
00:43It isn't even the best approach using a JavaScript solution.
00:46But this is a great effect that comes with Bootstrap that will give you the
00:51option of having your navigation bar shortened as the screen sizes get a bit smaller.
00:56And I'm going to show you how that works now.
01:00So if you open up the Dreamweaver document inside your exercise files, this is
01:04the finish point for the last video from the last chapter.
01:08We're going to add some additional code to this.
01:10Also inside your exercise files is a little text document here that
01:15contains some code.
01:17So this is the first little bit of code that we're going to add to our
01:21Dreamweaver page here.
01:22I'm just going to go ahead and highlight this bit of code here and say Edit > Copy.
01:28And then inside of my Dreamweaver page, just after the navigation tag but before
01:34the brand, so after this div right here but before that Roux Academy Conference
01:40line, I'm going to Ctrl+V or Command+V to Paste that in place.
01:45And I'm going to give this just a little bit of formatting here, just so we can
01:51make it a little bit easier to read. There we go.
01:55So what is this little chunk of code that we just copied in here do?
01:59Well, first of all, you'll see these three lines, lines 20 through 22, these are
02:04calling the glyphicons.
02:06So there's an icon that's called the icon bar.
02:09It's just a little line, and we have three of them here stacked on top of each other.
02:12So, that's all that part is.
02:14The interesting part with a part that makes this interactive is what's inside of
02:18the a tag, the clickable link here.
02:21So you'll notice that this has been assigned a few classes, both the button and
02:27btn-navbar, and then you see this JavaScript calls for toggle collapse and
02:30data-target of .nav collapse.
02:32So what these are doing is they're integrating the JavaScript into this web page
02:38to make this little icon expand when it's clicked inside of the bar.
02:44So if you copy in this code just like this, this is going to make your navbar responsive.
02:49You can certainly swap out these three lines here where you have the three icon bars.
02:54You can take those out.
02:55You can put in a word like menu, for example, or you could put in a different
02:59icon if you wished so that there's something different that's clickable, and you
03:03would not change the functionality of what's happening here.
03:06The second part to what we have to do is show what's going to be hidden as the
03:11navigation bar collapses in size.
03:14And so we probably don't want to hide the brand, but we do want to hide all of
03:19this navigation right here.
03:21So what we're going to do is we're going to add another div tag here, and we're
03:27going to give it a class of nav-collapse.
03:34We'll close immediately after the bulleted list.
03:37If you're working with a later version of Bootstrap than version 2.1 that I'm
03:41using here in this video, you may also need to add a class of collapse.
03:46So, line 26 will read div class = "nav-collapse collapse."
03:55So, this particular div is indicating this chunk of code will be hidden as the
04:02navigation bar gets smaller.
04:04And the media query is going to trigger to display this navigation bar with just
04:09the brand, and this little button, because the rest of this which is inside this
04:13div of nav-collapse will be hidden when that transition happens.
04:18So go ahead and Save this page -- Ctrl+S or Command+S to Save.
04:22And if we put this into Firefox and I Refresh the page, immediately we don't see
04:26anything here with my browser maximized here on my Desktop computer.
04:30But if I make the page smaller, you can see that long around, actually quite
04:37wide, this icon now appears.
04:40Remember, that's the glyphicon.
04:41We have the three bars that are stacked on top of each other.
04:45And as I make the page progressively smaller, then the navigation bar is
04:51resizing very nicely.
04:52When you click this button, you'll notice that we get the full menu comes on up
04:56here with things oriented in a vertical manner.
05:00Any content that you have on the page will be pushed down underneath this black box.
05:06So this is how you can go about making your site navigation bar responsive just
05:12by adding these two bits of code.
05:13So we had a bit of code that triggered the JavaScript to cause the effect of
05:18this open and close right here on the web page as I click to open and click to close.
05:23And we added some markup that indicates what's supposed to show and hide when
05:28that button is clicked.
Collapse this transcript
Adding a dropdown menu to the navigation bar
00:00So over the course of the last few videos we've built this fully responsive navigation bar.
00:04We know that it will respond to smaller screen sizes by hiding this navigation where required.
00:10You can access it through JavaScript, which will make a nice easily clicked on navigation
00:16bar work great on a mobile phone.
00:18But you might be wondering about one aspect of this bar that we haven't explored yet.
00:22And that is there's only one level of navigation here, just the primary navigation is present.
00:28What about secondary navigation or tertiary navigation?
00:31How do we show that on this web page?
00:33Well, certainly you could always take the approach of plugging in, in left column or
00:38right on this web page or even another horizontal bar that might contain those secondary or tertiary links.
00:46But a popular approach these days is to include dropdowns, and I get requested to teach how
00:52to make dropdowns all the time.
00:53Well, finally, I'm going to show you how to do it.
00:56Dropdowns are very easy to add here within Bootstrap, and I'm going to walk you through
01:02how we might go about doing that now.
01:04So down here in Dreamweaver, I've added a bit of code to this particular page.
01:11So here is the link for schedule.
01:14Notice that starts with an li then we have our a tag with the /a.
01:18But the closing li doesn't occur until down here.
01:21Remember that these lists are actually nested within the li.
01:25That is the correct way to mark them up.
01:28So we have our ul here inside of that li with a /ul down here, and I have three bullets inside of that.
01:36What I'd like to do is have this become a dropdown menu.
01:39So let's take a look at where we are at this particular point.
01:43If you just open that document and then take a look at it inside of Firefox, you'll notice
01:49that we have indeed a bulleted list that appears right under the word schedule, which is great.
01:54But it's not really a dropdown, because of course, it's showing right there on the page right now.
01:59So we need to add some additional styles in order to make this a dropdown.
02:04The first thing I'm going to do inside of Dreamweaver is for this specific li, the li
02:10belonging to that word schedule, I'm going to add a class of dropdown, which of course
02:17indicates that a dropdown will follow within this li.
02:21Then in the href side of this I'm going to add a class of dropdown-toggle, and then
02:29I'm going to use that data-toggle which is what is helping to integrate the JavaScript
02:36data-toggle="dropdown" just like that.
02:43So we've added a class of dropdown-toggle and a data-toggle of dropdown to that a tag
02:48that's associated with the word schedule.
02:50Finally, what I want to do is add to the ul a class of dropdown-menu which is going to
03:00give me some styling here for the dropdown menu.
03:04So if you go ahead and save that--Ctrl+S or Command+S to save--Refresh the page inside of Firefox.
03:11Now you see that we have a navigation bar.
03:13When I move my mouse over schedule and I click, you'll notice that I get a dropdown menu.
03:18So there's Day One, Day Two, and Day Three, and all these are clickable and will take
03:23you to those particular pages.
03:25How did I know that schedule was the one that had the dropdown menu?
03:28Well, I knew because I coded it.
03:30But how is a visitor of my web page going to know that schedule is the dropdown menu?
03:35An excellent question.
03:36It's likely that a visitor isn't going to know that that's a dropdown menu.
03:40So we should probably indicate somehow that schedule has got more behind it than just a single link.
03:46So here back within Dreamweaver, we can add some additional code which will give us a
03:53little triangle that will appear right next to that word schedule that would indicate
03:57that a dropdown menu is located there.
04:00So right here after the word schedule, before the /a, go ahead and put in a span class of caret
04:11immediately followed by a /span.
04:14This little bit of code is going to put in that tiny little triangle arrow that would
04:18indicate that the dropdown lives right there.
04:21Save your page, Ctrl+S or Command+S, refresh the page inside of Firefox, and now the word
04:27schedule has the little triangle right next to it, which would indicate that if you click
04:31on that you now have some additional options to explore.
04:35So dropdowns are pretty straightforward to add to our navigation toolbar.
04:40Actually, they're pretty easy to add to tabs and pills as well.
04:43I'll show you how to do that in the next video.
Collapse this transcript
Adding a dropdown menu to the tabs and pill navigation
00:00Back in the last chapter we built a pill-based menu, and we're taking a look at a format of that right now.
00:07The pill-based menu had this rounded cornered blue rectangle indicating where you were on
00:13the page, and when you rolled over the navigation you had this light gray one that goes across the tab.
00:18I've added to this a secondary navigation right under schedule, which is where it appears right now.
00:25And I'd like this to be a dropdown menu, but at the moment it's displaying on this page in a static manner.
00:31So let's take a look at the code and see what we need to do to make this truly a dropdown menu.
00:37So if you take a look here inside of Dreamweaver, you can see that I have added this bulleted
00:41list right here, lines 23 to 27.
00:44They are located inside of the li for schedule. That is the correct way to mark this up.
00:49Note that you start with the opening tag here on line 22 and the closing tag on line 28.
00:54In between you have the bullet list, each with its own bullet.
00:58So to make this a dropdown menu, there are several things we need to do to make that happen.
01:03First of all, the li which contains the word schedule, we're going to need to add a class of dropdown.
01:11We'll also need to add a class to the ul located inside of that li.
01:17We're going to give that a class of dropdown-menu.
01:23So just adding those classes isn't going to do much for us.
01:26What we need to do now is make sure that the JavaScript is integrated into this, and where
01:30that will be applied is inside of the href, which goes around the word schedule.
01:35So here we will add a class of dropdown-toggle, and then we're going to add that data-toggle
01:44which as I told you has to do with the JavaScript of dropdown.
01:51And those two particular items the class of dropdown toggle and the data-toggle of dropdown
01:56will give us the functionality that is required to make this work.
02:00So go ahead and Ctrl+S or Command+S to save the page and refresh this in Firefox, and
02:07you'll see here that we have the menu.
02:10It doesn't look like there's a secondary navigation, but when I roll over the word schedule and
02:14click, you'll see that I get a dropdown that results.
02:17So that's pretty cool.
02:19But how did I know that I can click on the word schedule?
02:22Only because I coded it.
02:24We need to have some sort of indicator that the dropdown lives there under schedule.
02:28So to do that, we could add a little triangle that points downwards, and that would be a
02:34great indicator of that schedule is interactive and has a dropdown associated with it.
02:38So to do that, right here we have the word schedule. Just after that I'm going to put
02:43a space followed by a span class of caret and a /span.
02:49It's exactly what we just did in the navigation bar dropdown video.
02:56So go ahead and save that, and if you refresh in Firefox, you'll see that the word schedule
03:02now has a triangle by it.
03:05That triangle's clickable and our dropdown menu appears underneath.
03:09So based on the code that I've given you here, you can add as many dropdown menus as you
03:13wish to your web pages.
03:16You can continue to add those through every navigation item that's on this page.
03:21You could even apply them to some of these secondary navigation items. You could give
03:26them a nested list as well and have another dropdown appear from there as well.
Collapse this transcript
Tabbing within the same page
00:00On occasion, you may wish to tab between blocks of content within the same web page,
00:05usually through a tab like interface where you can click on various tabs within the page,
00:11see different kinds of information without the page having to reload or make another
00:15call to the server to switch between pages.
00:18Bootstrap has a great interface for making this kind of effect.
00:23So our starting web page looks like this right now. I have a bulleted list at the top with
00:28some names, and underneath I have some text, it's just marked up with h3 for a title and
00:34a paragraph of text that appears underneath. And we can see that here inside of Dreamweaver.
00:41So there's my bulleted list, and then underneath here's just a bunch of h3s and paragraphs.
00:47And what I'd like to do is turn this into a bunch of tabs that I can click on and see
00:52each of these artists' bios displayed individually rather than altogether on a page like a laundry list.
00:58So to make that happen, there's a couple of things that we need to do.
01:02First of all, we are going to need to do some markup here on the tabs.
01:05So we are going to start by taking this ul, and we are going to add a class of nav and nav-tabs.
01:16Then I need to indicate which one of these tabs is going to start off being the active one.
01:20So I guess I might make the first the active one, so I'll go ahead and give that a class of active.
01:26Obviously, I could have started with any of the other tabs as the active one, if I wished.
01:31Then I am going to add a data-toggle to the a href tag for all of these, and the data-toggle
01:37as we know is what's going to help pull in the JavaScript to make this page more interactive, data-toggle="tab".
01:46And we need to apply that to all three of these links, so I am just going to highlight
01:50that, Ctrl+C or Command+C to copy, Ctrl+V or Command+V to paste, so that it now appears
01:57in all three of these links.
01:58And finally, what I need to do is connect the specific link for Constance Smith, for
02:04example, with the chunk of text that's going to be below.
02:07The links that I have up there right now are just sort of dummy links. They don't actually go anywhere.
02:12So somehow I need to differentiate between these.
02:15So I'm going to give these names, so right here with the first one I am going to call
02:19this rewington, leave the Pound sign there in the front, the second one I'll call #smith,
02:26and the third one I'd call #ta.
02:28This is exactly what we would do if we were using anchors further down on the page with links on the top.
02:35The links the way these were coded would skip on down to a link say, a name ta, for example.
02:42It would jump on down the page wherever that happened to be placed.
02:44We are going to do something similar here, although JavaScript driven. All right!
02:48So that's the markup that we need for the list at the top.
02:51Then underneath we're going to need to add some markup here as well.
02:56First of all, I'm going to add a section to go around all of this with a class of tab-content.
03:07That section class is important because it's defining that this is the actual content for
03:11the web page here, and that's why I am using the section tag.
03:15So I'm going to go down and close that at the bottom.
03:19Then after the section tag, I'm going to add an article tag here, article with a class of tab-pane.
03:31So this article tag is going to get wrapped around what effectively is an article,
03:36the h3, and the paragraph.
03:38So I am going to go ahead and end that article down here, and I can indent this h3 and the p
03:45because now they are inside of the article tag.
03:47So what I did is just highlighted all those lines and just hit the Tab key.
03:52So I am going to go ahead and add the same article class of tab pane to the top of
03:58each one of these little mini articles, and always of course, make sure you close your
04:05tags, and I will Tab over the content here to show that it's inside of the article.
04:13One more time, paste again the article class of tab-pane", and we'll put in our /article down here in
04:20the bottom, and we'll tab over this chunk of code. Okay.
04:25So we have three articles with a class of tab-pane.
04:28We also need to add to the same article tag a couple of other pieces of information, one is an id.
04:34The ID in this particular case for this first one will be Rewington.
04:39Those of you who think about IDs in terms of CSS almost exclusively, if you're a front-end
04:46developer who just works with HTML and CSS, IDs are also used in JavaScript.
04:51And so what we're doing here is we are connecting the link at the top with #rewington to an
04:57ID down here underneath, the ID of rewington. We're connecting these two together.
05:01So whatever you called your links up here on the top, you're going to need to take that
05:06and identify them as IDs beneath inside of these articles.
05:09So I'll go ahead and add an ID of smith and further down an ID of ta.
05:22And one final thing that we're going to need to do, since Riley Rewington is the tab that
05:28I want to have come up by default when the page loads, I have already specified that
05:32up here on line 18 as having an li with a class of active.
05:36I'm also going to need to identify which piece of content is going to come up by default
05:42underneath, and that of course is the article here about Riley Rewington.
05:47So I'm going to indicate that that should come up when the page loads by adding a class
05:53of active to this article.
05:57So we have tab-pane and active here for the article class, while the other article classes are just tab-pane. All right!
06:03Now that we've got all this markup in place, go ahead and save your page, Ctrl+S or Command+S
06:08to save, and Refresh the page in Firefox, and you'll see that we have tabs now going across
06:15the top of the page.
06:16When I click on Constance Smith, you can see that her information loads here inside of the tab.
06:22The little dotted box I have up there because I have selected it at the moment.
06:26If I click away from that tab, that box goes away, and here's Xhou Ta, and you'll see that
06:32the bio for him is listed here as well. So we can click around in these tabs.
06:38Notice that the URL for the page never changes. We are just displaying different sections
06:42of the page here inside of these tabs.
06:45So this is a really handy effect. I see it in use on a number of websites these days.
06:49It's a little bit more interesting than those long laundry lists or skipping things down
06:54the page we used to do back about 10 years ago.
06:57This is a lot more fun, a lot more interactive, and certainly more attractive.
07:01Some of you might be wondering about Search Engine Optimization now that I've separated
07:05these out between the tabs, and the answer to that is Search Engine Optimization should
07:11not be impacted at all. Why is that?
07:14Well, if you take a look at the raw HTML for this web page,
07:18the raw HTML is all spelled out right there in the web page.
07:22So Google would be able to see that when it comes to visit your website.
07:25It can read all of the content there.
07:28It won't see the JavaScript, it won't see the JavaScript effects, it will see the links
07:32at the top of the page, they will see that those link down to further into the page where
07:37the IDs are, but the page is very readable to Search Engines, and all of the tabs can
07:42be indexed very easily by Search Engine Spiders.
Collapse this transcript
Creating modal windows
00:00A Modal window is a div that's actually embedded within your web page that appears on top of
00:07your page on a grayed background, and it looks kind of like a pop-up window.
00:12It's not a true pop-up in that it doesn't appear in a separate browser window.
00:16You may have seen this on many different websites.
00:19I'm here on the Bootstrap website, getbootstrap.com.
00:24I am on the JavaScript Tab, and I am on Modal over on the side.
00:28If you scroll down a little bit here, you'll see down here we have a link to a live demo.
00:33If you click this big button here that says Launch demo modal, you'll see how the screen
00:38grays back a bit, and this window seems to scroll in to place.
00:43The window is comprised of three parts, we have a heading up here on the top with a little
00:46Close button over here on the side, the little X.
00:49There is some main text here to keep the Modal window that's very long from scrolling off the web page.
00:56You see there's a scrollbar here on the side.
01:00Then down at the bottom, we have a button to close the window or a button to save changes.
01:05The Save Changes button may be a little bit distracting to you because you're wondering
01:08what can you possibly change within this window? And you'd be correct, there's nothing in that
01:12window you can actually change.
01:14However, if this window was hooked up to a database, you might be able to make some changes
01:19within a Modal window and save those changes.
01:22Many content management systems use a feature like this. All right!
01:25I am going to close that. I am going to close my tab.
01:29And this other tab is our modal.html file, which is in your exercise files.
01:34This is our starting point here for how this is going to be laid out.
01:37Up at the top of the page here is the text, click me!
01:41That is going to be our big button that we'll see on the web page.
01:44The rest of this will wind up being the Modal window.
01:47And you see here the button with the X on it will wind up being that little X that appears in the corner.
01:52We have some text that we'll be talking about what's going on in the window, and then down
01:56at the bottom, there's a button to close the window.
01:59So we need to get to styled-up, and we need to apply some JavaScript to make the window appear and disappear.
02:05So, if we hop on into Dreamweaver, here's all of the code here that I just described,
02:12here is the link at the top, and we'll apply quite a bit of styling, and JavaScript to
02:18that in a little bit.
02:19Then I have a section here for the web page. The section is comprised of three parts.
02:24There's a header which contains that little X button as well as the heading.
02:29We have some text that describes the event.
02:32This is just the blah-blah that's there inside of the window, and then down at the bottom,
02:36we have the footer with the Close button.
02:38So, I am going to walk you through how we're going to set up the styling for this.
02:42First of all, starting up here at the top with the header, we are going to give this
02:46a class of modal-header.
02:48I am going to wrap a div around the text here that's in the middle.
02:54I am going to give that div with a class of modal-body.
03:03We'll tab these over a little bit. Make the code a little easier to read.
03:08And I'll close the div down here.
03:13Then of course, for the footer, we'll give it a class of modal-footer. So, there we go!
03:20We've identified the three sections of our Modal window, a header, a body, and a footer.
03:25So that's all in place. Now, let's apply some styling to the buttons.
03:29So, the button down here at the bottom, the Close button, I need to give this a class,
03:35and I am going to give it a class of button, btn, and styling of these buttons I covered
03:39in an earlier video in the CSS chapter. I want to make this button blue.
03:44So, I'm going to give it another class of btn-primary, which will give it a lovely blue color.
03:50For the button that's further up on the page here, the little X, we'll do something slightly different.
03:56We're just going to give this a class of close.
03:59Now, for both of these buttons, the functionality behind them is exactly the same, and what
04:05that is is when they're clicked, the Modal window should go away.
04:09And there is an attribute that we can add that will make that magic happen and talk
04:12to the JavaScript, that is data-dismiss, and that is modal is the value.
04:20So, I need to add that to both of those buttons, data-dismiss="modal". There we go! All right!
04:30Now that that's all in place, let's style this link that's up here at the top of the
04:34page, the one that says click me!
04:36We'll go ahead and give that a style, we'll give it a class of btn for button because
04:41we want it to look like a button.
04:43Just to be different, let's give it a class of btn-warning, which is going to make it
04:47a lovely shade of orange.
04:50And I also want it really big, so let's give it a class of button-large.
04:54So, that starts off with the styling there.
04:57The next thing I need it to do is make sure that when the button is clicked that something
05:02happens to this whole section that contains the Modal window information.
05:07And the way to do that is to change the href here from just the pound sign to something like launch.
05:15And up here in the section, I'm going to give this a matching ID of launch.
05:21Remember, that the ID here for section, whatever it is that you call that, should then be called
05:26via pound that ID name within the href.
05:30Then last of all in the href area, I am going to add a data toggle, data-toggle="modal".
05:43And that will mean that it will call up the Modal window when this button is clicked,
05:48and that data-toggle will be talking to the JavaScript that makes that happen.
05:51Finally, let's add a little bit of styling here to the section.
05:55So, we're going to give this a class of modal.
05:58That's going to control the appearance and disappearance of the window.
06:01We'll also give it hide and fade.
06:06Hide and fade will help drive that nice slide as it comes in and as it goes away again. All right!
06:12Now that we've got all of that in place, go ahead and say Ctrl or Command+S to save, and
06:17off to Firefox, just hit your Refresh button.
06:20And you'll see that we have a big orange button that says click me! on this page.
06:24Go ahead and click it.
06:25Lo and behold, here comes your Modal window exactly as you would expect it to appear.
06:31Notice that when I click the Close button at the bottom, it goes away, and the screen
06:35comes back to full brightness.
06:37If I click this again, I can click the little X in the upper right-hand corner, and it behaves
06:42exactly the same way as the Close button. So Modal windows maybe very helpful to you.
06:48They're nice for search engine optimization because all of the text that's within that
06:51Modal window is available to search engines to read as opposed to a pop-up window which
06:56is a separate HTML document.
06:58So, this is something even though we're using JavaScript, it shouldn't detract from your
07:02search engine optimization results, and you now have everything you need to put Modal
07:08windows to work inside of your Bootstrap website.
Collapse this transcript
Creating a photo carousel
00:00The last JavaScript effect I am going to show you is the Image Carousel, and this is so cool.
00:05People love these carousel kind of effects.
00:09You see it in action right here on this web page.
00:11Here we've got a series of photos that are scrolling on by with some text underneath.
00:17We have little buttons here so that I can click to the next image as fast or as slow as I want.
00:21I can go backwards.
00:23These carousels are pretty much everywhere on the web these days, and there's a thousand
00:28different ways to code them. Well, we're going to learn the Bootstrap way of doing it.
00:32So if you take a look at your starting Carousel document, you will notice that we have some photos here.
00:37They have a little bit of text that go underneath of all of these.
00:41There is down here at the bottom some tiny little left and right arrows, and if we take
00:46a look at this in Dreamweaver, you'll see that that code is exactly the same.
00:50We have some images, we have some headings with little bit of text underneath, and then
00:56down here at the bottom we have little left and right arrows.
01:00Now what we need do is mark this up to make it all work for the carousel.
01:05So first of all, the easiest thing to add are some divs here which will designate where
01:10the captions for this carousel are going to be.
01:13So just after the image, before the h4, we are going to add a div with a class of carousel-caption.
01:24And then of course, after the last closing paragraph, make sure you close the div.
01:31And I am going to do that three times here, div with a class of carousel-caption, and one
01:43more time, div class carousel-caption, /div. Okay.
01:57So we have marked off where those carousel captions are going to appear, now we have
02:02basically a unit that occurs here, the image plus the carousel caption, that is all a grouping itself.
02:08So I am going to add another div for that, this is a div with a class of item, and I
02:20am putting a little bit of spacing between each one of these groupings just to make things
02:23a little bit easier to read, div class item, one more up here on the top.
02:40You will notice that once again, as I have done with many of the other videos in this
02:48title, I am not using the grid system here for displaying this carousel.
02:53Of course, you could take the code that I am going to put here in between the body tags,
02:57you could copy that into one of the columns inside of your grid to display on your website.
03:04That's a very simple thing to do.
03:06The other thing I want to add here for the very first item is I want to designate this
03:10as an active item. In other words, I want the carousel to start with the first one.
03:15So I am going to designate it as such. Now I need to add just two more divs.
03:20I am going to wrap everything that you see here in another div with a class of carousel-inner,
03:33scroll all the way down to the bottom, and we are going to close that tag just before
03:38the href down here in the bottom of the screen.
03:42Then just above that div with a class of carousel-inner, as you might expect since it was called inner,
03:47we have to have an outer one, right?
03:49So I am going to add one final div here to the mix.
03:53This will be div with a class of carousel.
03:59And then I am going to close that all the way down here just after the hrefs down
04:06here in the bottom, which will be that little arrow either way.
04:10Okay, in that div with a class of carousel, also give it a class of slide. This will cause
04:16the images to have that wonderful sliding effect from one to the next.
04:21Without the class of slide, what will happen is they will simply appear one after the other.
04:24And I am also going to give this an ID of artists. All right!
04:30So that's all the markup that we need for the actual content of the carousel.
04:35Now we are going to scroll on down to the bottom of the page where we have these links
04:39with the left and right arrows, and we are going to apply some additional classes and information down here.
04:46So for our left quote, let's go ahead and apply some styling to this.
04:52We give it a class of left as well as carousel-control.
04:59As you would expect, that's going to apply to the left arrow, make it go to the left
05:02side of the images, and likewise for the next arrow, let's go ahead and give that a class
05:11of right carousel-control.
05:16Instead of the href of just Pound here, we are going to give this an href of #artists.
05:22Just as we have seen before, the ID above needs to match the href so that the JavaScript can work correctly.
05:30And last of all is the action here that we have to have on this href, and in this case
05:35it's data-slide, and that will be previous, P-R-E-V ,for the first one and data-slide="next" for the last one.
05:50All right! So now that we have got all that information packed into these a tags down here at the
05:56bottom of the screen, we are ready to save our document.
05:59So Ctrl+S or Command+S to save the document.
06:02Go on down here to Firefox and refresh your page, and you should see a fully formatted carousel.
06:10It does stretch all the way across the page, that's because, of course, the containing element
06:16for this particular page is the body tag.
06:18I don't have the scaffolding in place to make this carousel smaller or larger.
06:23If I click my arrows here, you can see that the images jump in between just fine. Isn't that great?
06:31And of course, we have the text underneath, describing each one of our images.
06:35So the image carousel is a great way to show off photos on your website, add a little bit
06:39of sizzle and interactivity, and they are very fun and interactive.
Collapse this transcript
Conclusion
Other resources
00:00Thanks so much for taking the time to watch Up and Running with Bootstrap.
00:03I'm excited to share Bootstrap with you, because this great framework will be incorporated
00:08into Joomla! 3.0, due to be released in late September 2012.
00:13Be sure to check out my other videos at lynda.com, including Website Strategy and Planning, which
00:18will help you plan your website before you start building. And if you love Bootstrap
00:23and want to try it out as part of a Content Management System, well, you will need to know
00:27a Content Management System first.
00:29My Joomla! 2.5 Essential Training course is a great way to come up to speed with Joomla! quickly.
00:35Thanks again, and I will see you in another video.
Collapse this transcript


Suggested courses to watch next:

Twitter Essential Training (4h 26m)
Maria Langer

CSS: Page Layouts (8h 57m)
James Williamson


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 104,069 instructional videos.

get started learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 2,025 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.

preview image of new course page

Try our new course pages

Explore our redesigned course pages, and tell us about your experience.

If you want to switch back to the old view, change your site preferences from the my account menu.

Try the new pages No, thanks

site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked