3 - Bootstrap

HTML/CSS Frameworks

A design framework is a collection of re-usable code snippets which you can use to build a website. It is sometimes called a "design system", "style guide", or "pattern library", and will usually consist of three things:

  1. Brand guidelines define the appropriate typography, colors and logos to use.

  2. Components define re-usable code snippets for common requirements, like navigation menus.

  3. Helpers define additional code tools to construct the site, like layout grids.

The main goals of a design framework are to ensure design consistency and avoid writing the same code twice.

Bootstrap 4

Bootstrap is CSS and JavaScript code that we load in our HTML pages. Bootstrap's documentation describes how to write HTML code that fits the Bootstrap components, including a grid layout as well as several components.

Exercise (15 minutes)

Fork this repository and follow the instructions in the readme to create a new page and add a card component to it.


Note: Ignore any ads, icons, and interactive elements (which use Javascript). If you really want to grab icons, try taking a screenshot of them and making an image file out of that.

  1. Go to newsweek.com and have a look around.

  2. Set up a GitHub repository for this project.

  3. Create a new HTML document.

  4. Think about all the elements on the page and how they are grouped together.

  5. Add Bootstrap to your project by following the instructions at GetBootstrap.com. Use the examples on that page as templates for how to organize your page.

  6. Lay out the basic structure of the page using empty semantic HTML elements that are appropriately sized and which are positioned by using the appropriate Bootstrap classes.

  7. Set up the top title and navigation bar.

  8. Work your way down the page by filling in and positioning the additional sections.

  9. Try resizing the browser to see if it mimics the behavior of the real Newsweek homepage.

  10. Push your solution to GitHub.

Personal Website Project

Over the last two weeks, you've been building personal websites as part of your homework. Now we want you to take those websites and apply the knowledge you've learned to make them as good as you can. Some ideas:

  • Add Bootstrap 4 to your site and use some of the components.

  • Use re-usable class names to reduce your CSS code.

  • Validate your HTML code to find and fix problems.

  • Add a second page and link to it from your first page.

  • Try to style the first article differently so that it stands out from the rest.

By the end, you should have created a repository for your site on GitHub with all the commits you've made.


Last updated