Pew Pew Laser Blog

Code. Glass art. Games. Baking. Cats. From Seattle, Washington and various sundry satellite locations.

Past Blogs

Vertical Centering is Solved.

1.26.2015

Every once in a while, I see a passing reference to how impossible it is to center something vertically using CSS. But vertical centering isn't difficult, not anymore. Here are some methods for vertical centering using only CSS (even on elements of unknown height) which are completely feasible for most sites.

Flex

Flexbox makes it dead simple to vertically center an element. Assuming you've got a height (even in % or rems), just throw display: flex; on the outer element, and margin: auto; on the inner element. This uses the flexbox mode, which is pretty well supported as of IE11, Firefox 33, Chrome 11, iOS Safari 7.1, and Android Browser 4.4.

Translate

The 2D transforms offer wider browser support (adding IE9, IE10 and Android Browser 4.1+) and a slightly more complex implementation. Put any height and position: relative; on the outer element, and these specifications on the inner element. This still works when the inner element is using an unspecified (or auto) height. Example:

position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

In case you need even more options or details on these solutions, I've detailed more methods here on Codepen.

Ebook Reader (for iPad) Findings.

1.16.2015

I had been doing a lot of ebook reading on my iPad, but sometimes the experience was lacking due to the ereader application that I was using to read the book. Since then I put a variety of ereaders through their paces with various file types, and what follows is a summary of my findings.

Conditions

I only evaluated iPad ereaders. My primary use for ereaders is for technical books, with fiction novels being a less common use case. As such these were the features I cared about:

Apps tested

These were the applications I considered:

Conclusions

Dice Masters Constructed Deck Review - January 2015.

1.6.2015

January Dice Masters Deck I went to a constructed deck tournament for Dice Masters this weekend. I had fun, but didn't expect to lose so much. Here is a review of the cards I brought, and how effective they were in play.

Last Month

Next Month