The question, better explained is, using the above code, why do you have to apply the CSS attribute, border: none;, to the image tag within the anchor tag? Rather than using text-decoration: none;, to the anchor tag, like you would use it to apply to an anchor tag with text in it to remove the underline.
Observe... <a href="link.html" style="text-decoration: none;">text is now not underlined</a> <a href="link.html">text is now underlined</a> As the anchor tag automatically applies the blue, underlined part of the text, when surrounding an image tag it puts the underline on the image, but in a blue border form around the image. Why use border: none; to the image rather than text-decoration: none; to the anchor tag? If you have a page that needs all the links to have no underline or "border" (if an image is a link as well), why would want to have to have to declarations for that, rather than one? You could have: a { text-decoration: none; } a img { border: none; } but that takes a little more coding. Not that much more but still... you could have just used the a { text-decoration: none; }. -- Brett P. On Fri, Jan 16, 2009 at 11:26 AM, Johan Douma <johando...@gmail.com> wrote: > I'm not sure if I understand the question... > But it's actually easy to remove the borders from an image in an anchor tag > using css, not inline. > > a img{ > border:none; > } > > When that's done, you can do whatever you want with the link or with the > image. > > > Johan Douma > johando...@gmail.com > > 2009/1/16 Brett Patterson <inspiron.patters...@gmail.com> > >> Okay. That makes sense. >> >> -- >> Brett P. >> >> >> On Thu, Jan 15, 2009 at 3:52 PM, David Dorward <da...@dorward.me.uk>wrote: >> >>> Brett Patterson wrote: >>> > So, my question is this. Why does the image tag have to have the border >>> > placed on it, instead of placing the border or text-decoration styles >>> on >>> > the anchor tag? >>> >>> Consider the case: >>> >>> <a href="/"> <img src="/foo" alt=""> Ipsum Ipsum </a> >>> >>> A border around the entire thing would give a very different effect to a >>> border around just the image. >>> >>> There's no selector in CSS to select an element based on its descendants >>> either. >>> >>> -- >>> David Dorward <http://dorward.me.uk/> >>> >>> >>> ******************************************************************* >>> List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm >>> Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm >>> Help: memberh...@webstandardsgroup.org >>> ******************************************************************* >>> >>> >> >> ******************************************************************* >> List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm >> Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm >> Help: memberh...@webstandardsgroup.org >> ******************************************************************* > > > > ******************************************************************* > List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm > Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm > Help: memberh...@webstandardsgroup.org > ******************************************************************* > ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: memberh...@webstandardsgroup.org *******************************************************************