Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Aleksandrs Karevs
PLUS
Aleksandrs Karevs
Courses Plus Student 11,178 Points

Moving from static high-fidelity mockups to a Responsive Webstie

Hi everyone,

I am stuck. I have completed several courses here on Treehouse and learned a lot about HTML, CSS and JavaScript. It all seemed to make sense when I was watching all these videos and completing the assignments/tests.

So now I decided to actually implement my knowledge and start building my very own simple website from the ground up. I spent a few days designing the first page mockup for three devices starting from mobile (mobile first approach) and gradually moving to the Desktop version of the page. Ok, so I have finished designing it and here is the screenshot showing the mockups I have created: http://d.pr/i/1dfQ5 .

I wanted my website to be responsive so I took my calculator and started to calculate all those margins, widths etc in percentages (%) in order to make my page responsive. I found it to be quite tedious and I thought that I am doing something wrong. Than I was told that I need to re-design my mockup with grids in mind and use some existing CSS framework or CSS grid to make with pre-existing column layouts in order to make my life easier. And this is exactly where I began to get totally confused. I've started reading all those blogs about Grid systems, their advantages and disadvantages and in the end I decided to use a simple CSS Grid system (unsemantic grid system). And so here I am completely lost and have no idea how to implement this grid and to actually start coding my page. I've spent the last couple of days going through various posts on the SmashingMagazie, Evanto Tuts+ etc reading about grids and how to implement them and I still have no idea how to do it.

It would be really really great if there would be a course or a project here on Treehouse which would show the whole process from A to Z of designing a simple Responsive Website (from drawing wireframes to creating high-fidelity mockups in Photoshop or Sketch 3 to actually coding this design in text editor with all those fluid grids etc).

Does anyone know any good resources or maybe some external courses/videos or anything which would show me the entire process in details on how to go from designing a static website in Photoshop to actually implementing it and making it Responsive?

Any advice will be highly appreciated. Thanks.

Garrett Sanderson
Garrett Sanderson
12,735 Points

Hey Aleksandrs,

A lot of websites now run on css frameworks like bootstrap and foundation.

These grid systems are based off of a 12 column grid that is 100% responsive. I usually use gridulator with a 12 column set up and take the png and paste it into sketch or photoshop for my mock ups so I am close to what bootstrap or foundation is. You can always change the max pixels on foundation or bootstrap and the rest of the columns will change based on the max width.

Hope this helps!

3 Answers

Adam Hill
Adam Hill
7,492 Points

Whilst using an existing grid system can be helpful for a lot of people, you don't have to use one. The important thing is that you've decided how you want the site to look at certain breakpoints (which is often more than developers are handed by a creative team before they start work). Also to be responsive, not every element has to stretch/ squash, you can fix the margin/padding width at mobile to be a certain width (16px for example), and have the content grow with the screen size. When that begins to look a little out of proportion with the content (maybe tablet portrait) increase the margin/padding size (maybe 32px etc), and just tailor your media queries to get the look you want at each breakpoint withe the content, but not the gutters scaling in between.

Aleksandrs Karevs
Aleksandrs Karevs
Courses Plus Student 11,178 Points

Thanks Adam for your reply. I really appreciate it.

But what if I have actually designed my mockup with Bootstraps grid in mind, i.e: http://d.pr/i/DYWV (I have 12 column grid with the settings set from this table: http://d.pr/i/CAir and now I would like to actually begin the coding phase and start converting my static pixel based mockup into the actual website using Bootstraps CSS grid. As far as I understand it is a pretty simple process of simply going through my html code and adding certain classes (which are pre-defined by Bootstraps logic) and my content should be laid out nicely, right? I guess I need to go and learn a bit more about Bootstrap. I found a few tutorials about Bootstrap here on Treehouse, maybe its going to help.

Aleksandrs Karevs
PLUS
Aleksandrs Karevs
Courses Plus Student 11,178 Points

Garrett Sanderson , thank you very much for your reply. Garrett, I have actually applied the grid to my mockups already and here how it looks: http://d.pr/i/1dwEe . What I don't however understand is what to do next and how to install and start using this grid to layout my design components on the page. I've customzed the bootstrap css (removing everything except from their grid: http://d.pr/i/12aWm ) and have added it to my index.html document: http://d.pr/i/1hP33 . The grid I have used in my Sketch 3 mockup is in fact Bootsrap's grid, thus as far as I understand it should be pretty easy for me to implement this grid and start using it, but what I don't quite understand is to how to actually go about and start using it. .

I guess I need to dig deeper and learn more about the actual topic i.e "how to install and apply bootstrap grid to your project" or something along these lines.

Also, Garrett, one more question I wanted to ask you: is it a normal practice to use 12 column grid for both desktop and tablet versions of your website and use only 1 column: http://d.pr/i/gFc2 (actually 2 columns but with gutter between columns set to 0 because Sketch 3 does not allow to create a grid with only one column, so my settings are as follows: ) http://d.pr/i/1iTmt and this is how my mockup looks with this 1 column grid applied to it: http://d.pr/i/146p2 . This is another area I feel a bit lost but as far as I understand there is no reason to use a 12 column grid for a mobile mockup because normally all the layouts on mobile devices are pretty simple where elements are simply being stacked one on top of another, right? Will it be easy to replicate this behaviour in Bootsraps grid? i.e. to switch from a 12 column grid on desktop version of the website to only 1 (or 2 for that matter) columns on mobile devices? I was also told by one really cool designer (Rafal Tomal – www.rafaltomal.com) the following: "If you start with 12 columns on the desktop screen, then you may want to gradually reduce the number of columns on smaller screens. Of course, it has to make sense, so for example from 12 columns on the desktop, you may want to go down to 6 columns on the tablets. If you had 4 elements in one row (each taking 3 cols) on the desktop, then you can display them as 2 elements in 2 rows (each taking 3 cols) on the tablets".

Would be very thankful if you could elaborate on this subject and hopefully it will become much much clearer for me.

Thanks again for your support ;)

Julian Gutierrez
Julian Gutierrez
19,201 Points

There is really no need to change the amount of columns used. In mobile you can still use the 12 column grid, visually it will look like one column but your element will have a width of 12 columns.