Skip to content

Instantly share code, notes, and snippets.

@zanedr
Last active January 31, 2017 16:09
Show Gist options
  • Save zanedr/9c683e1e37f0a90adb0a7d9d21011c52 to your computer and use it in GitHub Desktop.
Save zanedr/9c683e1e37f0a90adb0a7d9d21011c52 to your computer and use it in GitHub Desktop.
CSS Layout Challenge
##### Challenge 1
Used an overarching div CSS tag to shape the boxes. Set the html order to put div3 before div2 so that float:right stacked correctly.
[Challenge 1](https://codepen.io/zaner/pen/VPyXYQ)
##### Challenge 2
Since div's are in block format, just specified where div2 and div3 needed to be placed.
[Challenge 2](https://codepen.io/zaner/pen/MJrVKK)
##### Challenge 3
Used position:absolute to pull div1 out and plop it on top of div 2.
[Challenge 3](https://codepen.io/zaner/pen/NdXYbQ)
##### Challenge 4
Just as in Challenge 3, used position:absolute to manually place div2 over div1.
[Challenge 4](https://codepen.io/zaner/pen/LxedWQ)
#####Challenge 5
Similar to Challenge 3, but with the addition of clear:both to maintain the shape while using the float property.
[Challenge 5](https://codepen.io/zaner/pen/KaZoqd)
#####Challenge 6
Used position:absolute to enable the use of bottom and right properties before manually placing div2 and div3 over div1.
[Challenge 6](https://codepen.io/zaner/pen/oBpqod)
#####Challenge 7
I use a lot of position:absolute throughout this entire exercise. Hope that's ok....
[Challenge 7](https://codepen.io/zaner/pen/LxemNq)
#####Challenge 8
I tried something entirely novel this time around. This will probably revolutionize the way people do CSS.
Just kidding. Position:absolute to the rescue again.
[Challenge8](https://codepen.io/zaner/pen/ygpjqj)
#####Challenge 9
Challenge 9: more position:absolute. This time, div2 and div3 are nested inside div1.
[Challenge 9](https://codepen.io/zaner/pen/KaZePB)
#####Challenge 10
If Challenge 9 drank too much and fell over it would look like Challenge 10. Position:absolute with nesting.
[Challenge 10](https://codepen.io/zaner/pen/OWzExv)
#####Challenge 11
More nesting, more position:absolute. I hope I'm doing this right.
[Challenge 11](https://codepen.io/zaner/pen/oBpyVw)
#####Challenge 12
Like a swollen version of Challenge 11. Could've done this without nesting. I feel like all of these could be done without
nesting as long as position:absolute is still legal.
[Challenge 12](https://codepen.io/zaner/pen/vgprqd)
#####Challenge 13
Created two overarching classes to color the squares black and gray, followed by more position:absolute.
[Challenge 13](https://codepen.io/zaner/pen/dNJjJK0
#####Challenge 14
I came. I saw. I position:absoluted.
[Challenge 14](https://codepen.io/zaner/pen/BpJPrX)
#####Challenge 15
Overarching classes for color and size of the respective blocks, followed by more absoluting.
[Challenge 15](https://codepen.io/zaner/pen/OWzwwK)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment