04 мая 2007

Google AutoFill - how to remove yellow background

Интересная штука Google AutoFill. Куча народу бьется чтобы убрать желтый бекграунд от гугловкого autofill.

Мега скрипты пишут http://code.jenseng.com/google/.

Попробовал - всего-то у проблемных инпутов выставить в стиле important на background-color

background-color: #0F333F !important;

и вуаля. Скорее всего такая логика тулбара - проверить стиль элемента перед вскрыванием кода



Problem:

you have site designed in a dark theme, saying dark background, white font.

By default google toolbar autocomplete cracks html for inputs or selects containing "email" "name" "address" and other buzzwords and changes background to yellow. As a result when visitor fills form, he enters text as white on yellow and can not easy validate his input

What to do?



For some reasons usually people try to fix this with javascript : for example http://code.jenseng.com/google/. Scripts are initializing on document.load, enumerate all inputs and selects in the document and change background style to default one.

When I first spotted this problem, I thought that javascript is the only cure, because toolbar was inserting style="background:yellow" directly into input code. According to CSS rules such styles can not be overwritten with css, but

Answer is pretty simple:

For problematic inputs specify background in the css style with the important attribute, for example:

background-color: #0F333F !important;

Mystery! Input is not highlighted with yellow color. In my opinion toolbar checks css setup of element. In case if the background is important in style file - this input is not cracked by toolbar. That's all workaround



Комментариев нет:

Архив блога

What to do?

Problem:
you have site designed in a dark theme, saying dark background, white font.
By default google toolbar autocomplete cracks html for inputs or selects containg "email" "name" "address" and other buzzwords and changes background to yellow. As a result when visitor fills form, he enters text as white on yellow and can not easy validate his input
What to do?

Таги

Followers

item http://www.voronenko.com/2007/05/google-autofill-how-to-remove-yellow.html