Getting rid of border around image

Discussion in 'HTML' started by Kevin Audleman, Feb 10, 2008.

  1. This should be very simple. I've got an <a> tag surrounding an <img>
    tag which puts a big blue border around the image. How do I get rid of
    that border? I've tried <a style="border: none"> but the border
    stays...

    Any help appreciated.

    Thanks,
    Kevin
    Kevin Audleman, Feb 10, 2008
    #1
    1. Advertising

  2. On Feb 9, 6:49 pm, Kevin Audleman <> wrote:
    > This should be very simple. I've got an <a> tag surrounding an <img>
    > tag which puts a big blue border around the image. How do I get rid of
    > that border? I've tried <a style="border: none"> but the border
    > stays...
    >
    > Any help appreciated.
    >
    > Thanks,
    > Kevin


    Oh yeah, you can see my site here: http://quick2m.com/izzy/index.php
    Kevin Audleman, Feb 10, 2008
    #2
    1. Advertising

  3. Kevin Audleman

    asdf Guest

    "Kevin Audleman" <> wrote in message
    news:...
    > This should be very simple. I've got an <a> tag surrounding an <img>
    > tag which puts a big blue border around the image. How do I get rid of
    > that border? I've tried <a style="border: none"> but the border
    > stays...
    >
    > Any help appreciated.
    >
    > Thanks,
    > Kevin


    try: <img style="border:none" src... etc... instead.


    or if you want to remove borders for ALL images, do it with CSS instead (a
    much better solution, IMO)

    so... in CSS...

    img {
    border: none;
    }

    ....or...

    img {
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
    }

    ....if you want to remove borders ONLY for those images inside 'a' tags, try:

    a img {
    border: none;
    }

    Have fun playing!
    asdf, Feb 10, 2008
    #3
  4. Kevin Audleman

    dorayme Guest

    In article
    <47ae6fbc$0$3350$>,
    "asdf" <> wrote:

    > try: <img style="border:none" src... etc... instead.
    >
    >
    > or if you want to remove borders for ALL images, do it with CSS instead (a
    > much better solution, IMO)
    >
    > so... in CSS...
    >
    > img {
    > border: none;
    > }



    About your "really" asdf, some people would say that <img
    style="... *is* css. I know what you mean I think.

    "CSS" is quite a curious phrase, its exact grammatical nature
    hard to pin down from the multiple contexts it is used in. There
    is no obvious sheet about it in some contexts. <g>

    I got all thingy about this years ago and probably said something
    clueless and Steve Pugh thought I was on drugs. (I notice he pops
    up now and again, I used to enjoy his posts for their nice
    clarity)

    --
    dorayme
    dorayme, Feb 10, 2008
    #4
  5. Kevin Audleman

    rf Guest

    "dorayme" <> wrote in message
    news:...
    > In article
    > <47ae6fbc$0$3350$>,
    > "asdf" <> wrote:
    >
    >> try: <img style="border:none" src... etc... instead.
    >>
    >>
    >> or if you want to remove borders for ALL images, do it with CSS instead
    >> (a
    >> much better solution, IMO)
    >>
    >> so... in CSS...
    >>
    >> img {
    >> border: none;
    >> }

    >
    >
    > About your "really" asdf, some people would say that <img
    > style="... *is* css. I know what you mean I think.


    What else could it be. Even the HTML spec states that the value of the style
    attribute is CSS.

    http://www.w3.org/TR/html401/present/styles.html#adef-style

    --
    Richard.
    rf, Feb 10, 2008
    #5
  6. Kevin Audleman

    GTalbot Guest

    On 9 fév, 21:49, Kevin Audleman <> wrote:
    > This should be very simple. I've got an <a> tag surrounding an <img>
    > tag which puts a big blue border around the image. How do I get rid of
    > that border? I've tried <a style="border: none"> but the border
    > stays...
    >
    > Any help appreciated.
    >
    > Thanks,
    > Kevin


    Kevin,

    Removing borders around clickable images, around reactive images is
    not recommendable as this removes the visual cue indicating that the
    image is clickable, reactive. It's even a now standard usability
    issue: perceived affordance of clickability, speed up scanning of
    webpage, easying the reader/visitor's task of figuring out fast what's
    clickable and what's not clickable. "Don't make me think" is even now
    another standard principle in webpage design.

    http://www.useit.com/alertbox/20040510.html

    "removing the border that indicates an image is a link makes it harder
    for users to distinguish quickly and easily which images on a web page
    are clickable."
    http://www.htmlhelp.com/faq/html/images.html#no-border

    Regards, Gérard
    --
    Internet Explorer 7 bugs
    http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/
    GTalbot, Feb 10, 2008
    #6
  7. Kevin Audleman

    dorayme Guest

    In article <Dfyrj.13090$>,
    "rf" <> wrote:

    > "dorayme" <> wrote in message
    > news:...
    > > In article
    > > <47ae6fbc$0$3350$>,
    > > "asdf" <> wrote:
    > >
    > >> try: <img style="border:none" src... etc... instead.
    > >>
    > >>
    > >> or if you want to remove borders for ALL images, do it with CSS instead
    > >> (a
    > >> much better solution, IMO)
    > >>
    > >> so... in CSS...
    > >>
    > >> img {
    > >> border: none;
    > >> }

    > >
    > >
    > > About your "really" asdf, some people would say that <img
    > > style="... *is* css. I know what you mean I think.

    >
    > What else could it be.


    An inline css instruction is a bit of css. It is different from
    html presentational mark up. But asdf's reluctance is sort of
    understandable because of the curious way in which "sheet" loses
    its literal meaning. (We can say anything we like because he is
    probably asleep in some godforsaken cold north hemisphere city.)

    One might make some people more comfortable by calling an inline
    style, an inline cascading style instruction, but that is not how
    it has gone. Most of us are quite comfortable with the curiosity
    of an absence of any sheetness about a lonely inline style and
    happily call it inline css.

    Perhaps a defence of this terminological curiosity is that even
    an inline style has to take its place in a cascade of a style
    sheet, either one supplied by the author externally linked or by
    the browser (it almost always wins, but that is a mere detail. It
    still has to front up in the ring to claim its victory and so is
    sort of part of that big one sheet virtually considered... O
    Christ, I am too sober to go on with this... <g>

    --
    dorayme
    dorayme, Feb 10, 2008
    #7
  8. Kevin Audleman

    Andy Dingley Guest

    On 10 Feb, 07:33, dorayme <> wrote:

    > About your "really" asdf, some people would say that <img
    > style="... *is* css. I know what you mean I think.


    Well I know what you mean, and '<img style="...' _isn't CSS it's HTML.
    The piece _inside_ the style attribute is CSS, but not its wrapper.

    An external or an embedded CSS stylesheet is the better coice here of
    course. If you can make a blanket statement like "Image links
    shouldn't have borders", then you're blanketing the whole page or
    site. I doubt you'd want to do each <img> tag on-by-one.
    Andy Dingley, Feb 10, 2008
    #8
  9. Kevin Audleman

    dorayme Guest

    In article
    <
    m>,
    Andy Dingley <> wrote:

    > On 10 Feb, 07:33, dorayme <> wrote:
    >
    > > About your "really" asdf, some people would say that <img
    > > style="... *is* css. I know what you mean I think.

    >
    > Well I know what you mean, and '<img style="...' _isn't CSS it's HTML.
    > The piece _inside_ the style attribute is CSS, but not its wrapper.


    Well, OK! That settles it if that is what asdf was meaning and
    sorry, asdf. I should better have said that this *is* doing it
    with css, namely the bit inside. And then gone on to rave about
    something that has always seemed (trivially) quixotic to me...

    This is the big week in Australia to say sorry and I am going to
    take every opportunity to partake in the national spirit:

    http://preview.tinyurl.com/2q2ct4

    Do I owe any apology to anyone else? This is your chance to get
    it folks. A once in a lifetime, no questions asked, offer.

    --
    dorayme
    dorayme, Feb 10, 2008
    #9
  10. Kevin Audleman

    asdf Guest

    "dorayme" <> wrote in message
    news:...
    > In article
    > <47ae6fbc$0$3350$>,
    > "asdf" <> wrote:
    >
    >> try: <img style="border:none" src... etc... instead.
    >>
    >>
    >> or if you want to remove borders for ALL images, do it with CSS instead
    >> (a
    >> much better solution, IMO)
    >>
    >> so... in CSS...
    >>
    >> img {
    >> border: none;
    >> }

    >
    >
    > About your "really" asdf, some people would say that <img
    > style="... *is* css. I know what you mean I think.
    >


    Yeah, yeah... ok, ok... u got me... I *meant* a CSS stylesheet file. I
    figured most folks would know what I meant, though.

    > "CSS" is quite a curious phrase, its exact grammatical nature
    > hard to pin down from the multiple contexts it is used in. There
    > is no obvious sheet about it in some contexts. <g>
    >
    > I got all thingy about this years ago and probably said something
    > clueless and Steve Pugh thought I was on drugs. (I notice he pops
    > up now and again, I used to enjoy his posts for their nice
    > clarity)


    Pedantry will get you everywhere :)))
    asdf, Feb 10, 2008
    #10
  11. Kevin Audleman

    asdf Guest

    "dorayme" <> wrote in message
    news:...
    > In article
    > <
    > m>,
    > Andy Dingley <> wrote:
    >
    >> On 10 Feb, 07:33, dorayme <> wrote:
    >>
    >> > About your "really" asdf, some people would say that <img
    >> > style="... *is* css. I know what you mean I think.

    >>
    >> Well I know what you mean, and '<img style="...' _isn't CSS it's HTML.
    >> The piece _inside_ the style attribute is CSS, but not its wrapper.

    >
    > Well, OK! That settles it if that is what asdf was meaning and
    > sorry, asdf. I should better have said that this *is* doing it
    > with css, namely the bit inside. And then gone on to rave about
    > something that has always seemed (trivially) quixotic to me...
    >


    I have no idea what you are apologising for, but accepted anyway.

    In any case, this argument does not help the OP, or anyone else, one whit.
    Ok, Ok, I was very tired when I wrote my original reply, and figured that
    the OP and others reading it, would know what I meant.
    asdf, Feb 10, 2008
    #11
  12. Kevin Audleman

    kendalk08 Guest

    Kevin Audleman wrote:
    > This should be very simple. I've got an <a> tag surrounding an <img>
    > tag which puts a big blue border around the image. How do I get rid of
    > that border? I've tried <a style="border: none"> but the border
    > stays...
    >
    > Any help appreciated.
    >
    > Thanks,
    > Kevin


    all you need to do is set the border="0" attribute on the image tag.
    example: <img src="image.jpg" border="0">
    kendalk08, Feb 13, 2008
    #12
  13. kendalk08 wrote:
    >
    > Kevin Audleman wrote:
    >> This should be very simple. I've got an <a> tag surrounding an <img>
    >> tag which puts a big blue border around the image. How do I get rid of
    >> that border? I've tried <a style="border: none"> but the border
    >> stays...
    >>
    >> Any help appreciated.
    >>
    >> Thanks,
    >> Kevin

    >
    > all you need to do is set the border="0" attribute on the image tag.
    > example: <img src="image.jpg" border="0">


    Yes in 1996. In this century put "a img { border: 0; }" in your stylesheet.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Feb 13, 2008
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kian
    Replies:
    18
    Views:
    67,536
    SickHabitz
    Nov 27, 2012
  2. Replies:
    23
    Views:
    932
    Neredbojias
    Mar 28, 2006
  3. Jack Jarmush
    Replies:
    3
    Views:
    4,558
    Jack Jarmush
    Aug 3, 2009
  4. TS
    Replies:
    5
    Views:
    697
    Jeffrey Tan[MSFT]
    Aug 10, 2005
  5. Replies:
    8
    Views:
    258
    A. Sinan Unur
    May 25, 2006
Loading...

Share This Page