Hide outline border on A tag focus

Thursday, October 15, 2009

Filed under: HTML and CSS, jQuery, javascript, web-development — Tags: , , , , — Dmitri @ 09:01

When you focus A tag or submit button sometimes outline border looks ugly on websites. Here are examples:
Foobar toyota

This can be easy fixed (for all browsers except Internet Explorer!) by adding 1 line of CSS rule:
a:focus { outline: none; }

IE has non-standard HTML attribute hideFocus=”true” to solve this problem. Of course you don’t like to put this attribute in every <A> tag and submit buttons in your HTML. I have 2 working solutions for all browsers:

CSS expression solution

input, a {
  outline:expression(hideFocus='true');
  outline:none;
}

jQuery solution

$("a, input").each(function() {
  $(this).attr("hideFocus", "true").css("outline", "none");
});

Internationalization in Rails 2.2

Tuesday, October 13, 2009

Filed under: Ruby, Ruby on Rails, web-development — Tags: , , , — Dmitri @ 08:41

This tutorials is about Internationalization in Ruby on Rails 2.2 and later. You don’t need to invent a wheel from scratch all stuff for internationalization and localization of your application is available in standard Rails package since version 2.2.

Complete internationalization tutorial

© 2008 Dmitri Smirnov