We're going to practice our CSS by trying to recreate some layout examples I've found around the web. You're probably familiar with these sites already, if not these specific pages. For each site, I took a screenshot of a particular portion of a page that employs some of the CSS tricks we've been learning. I also provided a folder for each example, so you can create separate pages with their own stylesheets. The code is up to you!
Try to break the layout down into smaller chunks and solve one portion at a time. It might help to work from the general to the specific, meaning try to place everything in an overarching layout before trying to tweak the placement of minute elements like icons. These don't have to be pixel perfect, by the way. I would rather you focus on getting all of the layouts close instead of spending an hour trying to find the right font to use.
If you hit a wall, take a break. Go for a walk. Work on a different layout. Whatever you do, don't get frustrated. This will be a tough lab and I don't expect you to finish all of it. If you need to, you can also go find the page and inspect the code to see how they did it. Be careful though, they might be using things we haven't learned yet. You should be able to accomplish this with all the tools we've learned so far.
Some things to keep in mind:
- Try to use semantic HTML as much as possible.
- When you get to a good spot, use git to commit the code and save a snapshot just in case.
- If you are going to try an experiment, use a branch! That way you can merge it in if it works or drop it if it doesn't.
- But most importantly, Perfect is the enemy of Good.