Book Image

Responsive Web Design by Example

By : Frahaan Hussain
Book Image

Responsive Web Design by Example

By: Frahaan Hussain

Overview of this book

Desktop-only websites just aren't good enough anymore. As you enter a future of increasingly diverse browsing methods, you need to know how to build websites that are presentable and will work perfectly with the huge volume of different device sizes and resolutions that are now commercially available. Responsive web design is an answer to the problem of modern web development. By following the detailed step-by-step instructions, previews, and examples mentioned in this book, you will learn how to build engaging responsive websites and upgrade your skills as a web designer. With coverage of Responsive Grid System and Bootstrap, you will learn about the most powerful frameworks in responsive web design. In this book, you will learn how to create a crisp blog page, a beautiful portfolio site, a cool social networking page, and a fun photo gallery. Through each of these projects, you'll learn how to build various elements of a modern responsive website, and also find out which framework works best for your project specifications. By the end of the book, you will have gained practical skills you need to build real-world websites that are professional, creative and truly responsive.
Table of Contents (15 chapters)

Responsive grids and columns

The grid system is one of the universal concepts of Responsive Web Design, regardless of the framework a website is built upon. To put it simply, websites are split into rows and columns, and if an object/element occupies half the number of columns, it will always occupy that many regardless of the screen's size. So an element that occupies 3 of the 12 rows will occupy 25% of the width of its parent container, hence providing responsive design. This is great for small variations in screen sizes, but when a website is viewed on platforms varying from desktops to mobiles, then breakpoints are introduced as covered previously. Though there is no fixed number of columns that a responsive website should have, 12 is a common number used by some of the most popular and widespread frameworks. A framework in this context is anything built on top of the built-in web features. JavaScript is a web feature, but jQuery is a framework built on top of that to allow easier manipulation of the website using prewritten libraries/code. Though a framework isn't absolutely necessary, neither is using an off-the-shelf web browser. You could create your own, but it would be an immense waste of time, and the case for using a responsive framework is essentially the same. The following is an example of a basic responsive grid:

Rows allow us as developers to group content together, though there will be a fixed number of columns, not all columns have to be filled to go to the next row. A new row can be used explicitly, as can be seen in the following example:

This may be different to how you have developed websites in the past, but if there is anything you are unsure about don’t worry, as things will become clearer when we start working on projects in future chapters.