Archive for September, 2011

Disable default appearance of input elements in WebKit and iOS

If you’ve tried out any of HTML5’s new input types you’ll probably have noticed that WebKit adds its own default styling to search input fields. This can be a bit of a pain if you’re trying to achieve a particular layout, so you can remove them using the following CSS:

input[type="search"] {
	-webkit-appearance: textfield;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
	display: none;
}

Similarly, if you’re browsing the web on an iOS device you’ll notice that it also applies its own appearance to input and textarea elements: rounded corners, grey gradient in the background, etc. This is an even simpler fix, however:

input, textarea {
	-webkit-appearance: none;
}

More on appearance can be found at the W3C editor’s draft.

Mac OS X 10.7 Lion and PHP

There are a one or two points to note about your PHP configuration before (or after) you upgrade from Snow Leopard to Lion.

Firstly, PHP has been upgraded from 5.2 to 5.3.

I also discovered that my php.ini in /etc/ had been moved to php.ini.default-5.2-previous. This can easily be reverted, however:

sudo cp php.ini-5.2-previous php.ini

One other thing to note, though, is that any extensions you may have had installed under /usr/lib/php/extensions/no-debug-non-zts-20090626/ will have been removed. If you do have any, they will need to be rebuilt.