Flexible floated layouts were achieved by giving each element a percentage width, and ensuring that across the layout the totals were not more than 100%.
In the early days of responsive design, our only option for performing layout was to use floats. For example, if the line lengths become unreadably long as the screen size increases, or a box becomes squashed with two words on each line as it narrows.
That approach would be impossible given the vast number of differently-sized devices that exist, and the fact that on desktop at least, people do not always have their browser window maximized.īy using a flexible grid, you only need to add in a breakpoint and change the design at the point where the content starts to look bad. A flexible grid means that you don't need to target every possible device size that there is, and build a pixel perfect layout for it. Responsive sites don't just change their layout between breakpoints, they are built on flexible grids. The rest of this article will point you to the various web platform features you might want to use when creating a responsive site. Modern CSS layout methods are inherently responsive, and we have new things built into the web platform to make designing responsive sites easier. In Marcotte's original exploration this meant flexible grids (using floats) and media queries, however in the almost 10 years since that article was written, working responsively has become the default. It is important to understand that responsive web design isn't a separate technology - it is a term used to describe an approach to web design or a set of best practices, used to create a layout that can respond to the device being used to view the content. Sidebars could be repositioned for the smaller screen, or alternate navigation could be displayed. Rather than having one layout for all screen sizes, the layout could be changed. Media Queries enable the type of layout switch that Cameron Adams had previously explored using JavaScript, using only CSS. The third key component was the media query.This enables an image to scale down to fit in a flexibly-sized column, rather than overflow it, but not grow larger and become pixelated if the column becomes wider than the image. Using a very simple technique of setting the max-width property to 100%, images would scale down smaller if their containing column became narrower than the image's intrinsic size, but never grow larger. The second technique was the idea of fluid images.The first was the idea of fluid grids, something which was already being explored by Gillenwater, and can be read up on in Marcotte's article, Fluid Grids (published in 2009 on A List Apart).The term responsive design was coined by Ethan Marcotte in 2010 and described the use of three techniques in combination.