css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv
CodePen probably won't work great in this browser. We generally only support the major desktop browsers like Chrome, Firefox, Safari, and Edge. Use this one at your own risk! If you're looking to test things, try looking at Pens/Projects in Debug View.
user profile image


  1. This is super useful! I was wondering, have you encountered any problems with this so far? I noticed that the .centered element only stays aligned if it's width is < 100%. When I tried to apply this concept here http://codepen.io/uniZero/pen/fvkjJ I ended up with a magic max-width of 99%. Do you have any ideas in how I could prevent that?

  2. IMHO you should use min-height instead of height in your inline styles, so that content doesn't overflow the container when growing.

Leave a Comment Markdown supported. Click @usernames to add to comment.

You must be logged in to comment.