Christian Heilmann

Author Archive

How to remove the ugly border around an image in a link

Wednesday, December 14th, 2005

Common issuesThis question pops up almost weekly on message boards, mailing lists and in chat sessions:

How can I remove the ugly border around an image when it is linked?

I am amazed that this is still a question that needs to be asked, but the trick to remember is that when you put an image inside a link, like:


products

Then the browser puts a border around the image in the colour of the link. Therefore, changing the link border setting will not have any effect:

a {border:none; }

Instead, you need to set the image border to “*none*”:

 a img {border:none; }

It might be a good idea to define this as a preset in the beginning of your style sheet, to avoid the need to repeat it over and over again.

Also notice that the setting is “border:none”, which tells the user agent that there should not be a border – if you use “border:0” you expect the User Agent to know how to display a border with a width of 0, which might not be possible.

I hope that this is going to be a post to show up high in google sooner or later, much like the ugly yellow form fields one.

[tags]webdevtrick[/tags]

CAPTCHA Alternatives for a commercial product?

Tuesday, December 13th, 2005

Right now I am working on a project that will be a paypal-esque financial application, and of course security is a big issue with this one.

We had a great meeting talking about security measures that could be added to the forms to ensure that only real users will be able to log-in.

I collected the ones I could think of based on the W3C whitepaper and own experiences and this is the list with pro and contra for each of them: (more…)

Shorter DOMscript via cloning vs. generating elements

Thursday, December 8th, 2005

cloned sheepI just looked through some of my older scripts and other people’s code and realised that a lot of time we bloat our methods by repeating the same functionality.

This is especially true when it comes to generating a lot of HTML via the DOM.

We keep repeating the same document.createElement and setAttribute lines over and over. Wouldn’t it be more efficient to create those once when initialising our script and then cloning them? (more…)

RSS feeds everywhere, even in the smallest room

Thursday, December 8th, 2005

If you ever wondered if and where people read your RSS feeds, you might be in for a surprise, when your audience is in Taiwan. It seems there is a new product available that prints out RSS feeds onto toilet paper Would be great to have a control element to define the print strength, in case you want to leave a lasting impression.

What I want from CSS3 – nested declaration blocks

Tuesday, December 6th, 2005

Back in October, Andy Budd wanted to have min- and max-padding in CSS3, so it seems only fair that for my 200th post here I can also give my $.02 and ask (and maybe stomp my little feet) for something in CSS3 (after all we can celebrate together in well, roughly 2010 when all browsers support it – that is if we still use browsers then):

I want nested declaration blocks!

I basically want them as I hate repeating myself, and I hate repeating code when it is not needed. (more…)