Workshop
The workshop contains quiz questions to help you process what you’ve learned in this hour. Try to answer all the questions before you read the answers.
Q&A
Q. I’m worried that if I use Bootstrap, my web pages will look like every other Bootstrap site. How do I prevent this?
A. If you stick with the Bootstrap template or theme, then yes, you might risk creating a page that looks like a lot of other Bootstrap sites. But you can add your own styles to modify your website to look how you want. You will learn more about this in Hour 21, “Customizing Bootstrap and Your Bootstrap Website.”
Q. Is Bootstrap responsive?
A. Bootstrap automatically uses responsive web design (RWD) to adjust the pages for various screen sizes. This is covered in more detail in Hour 5, “Grids and How to Use Them.”
Q. What is the benefit of the Bootstrap Theme over the basic Bootstrap CSS?
A. The Bootstrap Theme uses the bootstrap-theme.css file to get what Bootstrap calls a “visually enhanced experience.” However, in my experience, most of the colors and visual enhancements are already included in the bootstrap.css file, so you don’t need this second theme CSS file. I never use it in my designs.
Quiz
What is the least amount of code you need to add Bootstrap to a web page?
- The Bootstrap CSS file
- The Bootstrap CSS and JavaScript files
- The Bootstrap CSS and JavaScript files and jQuery
- The Bootstrap CSS and JavaScript files, jQuery, and your custom CSS
- The Bootstrap CSS and JavaScript files, jQuery, and your custom CSS and JavaScript
- True or False: Bootstrap is not HTML5.
- True or False: Bootstrap plugins require jQuery.
- True or False: You must use the Bootstrap template to be compliant with Bootstrap.
Why is the <meta charset="utf-8"> line so important?
- Because without it, the characters won’t display.
- Because it tells browsers the page is internationally ready.
- Because without it, your page is vulnerable to certain hacker exploits.
- It’s not important.
- True or False: The X-UA-Compatible line is what makes the Bootstrap framework work in Internet Explorer.
- True or False: The viewport meta tag is what makes Bootstrap responsive.
What does the code <!--[if lt IE 9]> do?
- Nothing, it’s in a comment.
- It activates the following code in Internet Explorer 8 and lower.
- It activates the following code in Internet Explorer 9 and lower.
- It activates the following code in any version of Internet Explorer.
Where is the best location for the Bootstrap JavaScript file?
- In the <head> of the document
- Anywhere in the <body> of the document that you need scripting
- Just above the </body> tag, but before the jQuery script
- Just above the </body> tag, but after the jQuery script
- True or False: The bootstrap-theme.css file is the only way to get the Bootstrap colors and visual enhancements.
Quiz Answers
- a. The minimum you need to add Bootstrap to a web page is the Bootstrap CSS file.
- False. Bootstrap uses the <!doctype html> doctype, which indicates that it is HTML5.
- True. Bootstrap JavaScript plugins require jQuery to work.
- False. As long as you use the Bootstrap CSS and JavaScript files, you are using Bootstrap.
- c. Without the <meta charset="utf-8"> line in the <head> of your document, the web page becomes vulnerable to certain hacker exploits.
- False. The X-UA-Compatible line helps Internet Explorer work more effectively, but it is not required to get Bootstrap to work in that browser.
- False. The viewport meta tag helps the design look better in smaller screens, but it is not required for a responsive design.
- b. The line <!--[if lt IE 9]> is a conditional comment that activates the following HTML in versions of Internet Explorer lower than 9.
- d. The best place for the Bootstrap JavaScript file is the very last place in the HTML, just above the </body> tag, after the jQuery script.
- False. The Bootstrap Theme CSS file ensures that you have all the colors and visual customizations, but they are typically included in the standard Bootstrap CSS file by default.
Exercises
- Convert a web page you already have to Bootstrap using the instructions in this hour. Compare the new page to the old one in a web browser.
- Create a brand-new page using the Bootstrap standard template.