Daniel Friesen

(Dantman, Nadir Seen Fire)

Programmer, Web Developer, Animanga Fan

Posts in 2013

This post was last modified

One of the designs I recently had to work on needed a narrow width header in a sidebar with a large number on the left side of it and the header text vertically centered to the right.

If you've worked with CSS for awhile you've probably ran into the same issue as everyone else. Vertical alignment with universally supported css is not easy. There are multiple techniques you can use to make something vertically aligned but there are drawbacks to each.

For my use case I couldn't use any of the normal tricks I'd use. I didn't know the exact height of the number and I needed the header text on the right to wrap properly. So I couldn't use a typical technique involving line-height, absolute positioning, or padding.

[Read more...]

You probably already know about HTML5's <input type="number">. Which if supported by a browser displays a form input optimized for inputting numbers. Whether that means an up/down spinner or an optimized keyboard.

However iOS' standard behavior for the number input isn't that ideal. By default iOS will display a standard keyboard slightly modified with a row of numbers at the top. This isn't ideal as you don't need the alphabetic keys and iOS already has a full numeric keypad it could use for the input instead. For reference, other mobile OS such as Android already display their numeric keypad when focusing a number input.

A html5doctor article article went over this, pointed out a trick by Chris Coyier using <input type="text" pattern="[0-9]*"> in which the pattern forces iOS to use it's numeric keypad, and also mentioned HTML5's inputmode.

[Read more...]

Recently I re-looked over licenses and license related posts for a project at work. And after reading an old blog post on being sure to pick any license I thought about my blog posts. I've included code snippets in them sometimes for others to use and never declared any permissions for them.

Now the copyright of these simple functional snippets is relatively debatable and any license at all (even the tiny MIT license) is really too much for snippets. Frankly requiring attribution for any of them is relatively unwarranted.

So I've decided to go back and tag most of the code snippets on my blog releasing them as CC-0. You're free to use those snippets in any code you want and you don't even have to include attribution for them. ((;) Though if you feel like including a code comment next to your use of them pointing back to where you found them I'd be flattered.))

[Read more...]