ASP.NET Cafe
new tricks every week

Remove links outline in IE 7 and IE 6 with JQuery

Monday, 26 July 2010 10:55 by dmitriy

IE 7 doesn't respect css property outline so you can't remove annoying outline using following css:

* :focus { outline: none; }

But you can remove it using JQuery . Most of sites already have Jquery include so you don't need to add anything except following code.

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

If you're using Mootools or Prototype - you can rewrite this code for these frameworks easily.

And this won't affect your css validation!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   ASP.NET | CSS
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed

CSS: min-height everythere

Thursday, 13 December 2007 20:24 by dmitriy

Recently was an article on Digg... "Don't use CSS ever" or something like this... Opened link - just another SEO company. So, I decided to write post about CSS.

Sometime you need a block elements that should be specified size, but if there are more content - grow vertically. Basically, this is a frequent trouble for peoples who works long time with IE and then see the problems in Firefox.

Here is my little css:

 _height: 458px; /* IE 6 only */
 min-height: 458px;
 display:block;

That's all. All good browsers support min-height and IE uses "height" like min-height, but just need to make it IE-only, so we are using "_height" attribute.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   CSS
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed