Click here to Skip to main content
15,885,141 members
Articles / Web Development / CSS3
Alternative
Tip/Trick

Remove blue border when image is inside the hyperlink

Rate me:
Please Sign up or sign in to vote.
4.94/5 (9 votes)
8 Mar 2011CPOL 14.6K   4
DescriptionI...

Description


If one would want to restrict the no-border CSS rule only to certain images inside any anchor tags, it is advised to use a class CSS selector rule:

CSS Code


XML
<style type="text/css">
    a img.noborder
    {
        border: none;
    }
</style>

Usage


Using that in your HTML would look like this:
<a href="http://www.codeproject.com"><img src="Bobette.gif" alt="No border to see here!" class="noborder" /></a>


Note:


The same way that E#XYZ can be used to select any HTML element E with its attribute id set to XYZ the . can be used in E.XYZ to select any element E where its attribute class set to XYZ.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Atos Origin
Germany Germany
While teaching myself BASIC and assembler on a Commodore 64 in the early 80's I got seriously infected by a tough kind of programming virus. The disease turned chronic and has since then been diagonsed as incurable. So I thought I'd put my affliction to good use and studied computer science which, after some trial and error, finally fetched me a degree.


This is some of the ground I've covered over the last 20 years:

  • Database design & programming
  • Application programming
  • Systems programming
  • Web applications
  • Multimedia/HTPC platform development
  • eCommerce software platform
  • Design & development of FAST based search solutions

I will not engage in listing all the languages, frameworks and tools I've worked with. The list would be too long, most probably mainly meaningless and judging by what has been accumulated just over the last 2 years surely incomplete too.

There are of course some languages that deserve to be mentioned as they played a vital role in me becoming what I am now.


  • BASIC
  • Assembler (6502)
  • C
  • Scheme (Lisp dialect)
  • Java
  • C#

The last four years were spent designing and programming FAST based search solutions using FAST Enterprise Search Platform 5.1 & 5.3. Since MS has already announced that FAST ESP will not be further developed and will die by 2017/2018, we are now looking into other technologies like Lucene/Solr, Sinequa and FAST Sharepoint Search.

Comments and Discussions

 
Generalgood finding...Excellent. my vote of 5 Pin
Sunasara Imdadhusen19-Aug-11 18:29
professionalSunasara Imdadhusen19-Aug-11 18:29 
GeneralReason for my vote of 5 Good points Manfred Pin
Espen Harlinn14-Mar-11 22:41
professionalEspen Harlinn14-Mar-11 22:41 
GeneralRe: Thanks Espen! Pin
Manfred Rudolf Bihy14-Mar-11 22:53
professionalManfred Rudolf Bihy14-Mar-11 22:53 
General@Deeksha: Thanks for fixing my typo and yes, the examples in... Pin
Manfred Rudolf Bihy8-Mar-11 22:07
professionalManfred Rudolf Bihy8-Mar-11 22:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.