Code #1:

Responsive 2-column box that "floats" on hover, built with html and css

This page features a code snippet I played around with, which is making a two-column layout that changes into one column on a smaller screen, and has a float effect when hovered on.

Contents

Code Preview

This is the first box! If you're viewing this on a smaller screen like a tablet or smartphone with a size of less than 450px, this should be the first box you see. If you're viewing on a larger screen like a laptop computer you can resize the window to see the effect.

This is the second box! The "float" effect is achieved through the setting of margins, and adding a box shadow on hover. A transition effect is also added.

HTML code

The code snippets for here as well as the css section contain invisible comments to guide on how to customize the code further.

CSS Code