The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Quick HTML Question

RhinoRhino TheRhinLOLRegistered User regular
edited October 2007 in Help / Advice Forum
I have images on a webpage wrapped in an A HREF (ie. click on image to link to follow link).

How do I make the purple/blue border go away? I just want the image, not this purple/blue around it.

k, thanks.

93mb4.jpg
Rhino on

Posts

  • LewishamLewisham Registered User regular
    edited October 2007
    Is it <a href="blah" style="border:0px"> or <img src style="border:0px">

    I always forget. I think it's the latter. Try that one first.

    Lewisham on
  • DhalphirDhalphir don't you open that trapdoor you're a fool if you dareRegistered User regular
    edited October 2007
    Rhino wrote: »
    I have images on a webpage wrapped in an A HREF (ie. click on image to link to follow link).

    How do I make the purple/blue border go away? I just want the image, not this purple/blue around it.

    k, thanks.

    just add border=0 inside the img tags.

    Or the <a> tag.

    again, I forget which.

    try either <a href="yourlink" border=0><img src="yourimage"></a>

    or

    try this one <a href="yourlink><img src="yourimage" border=0></a>

    one should work

    i forget which.

    Dhalphir on
  • RhinoRhino TheRhinLOL Registered User regular
    edited October 2007
    Border=0 on the img tag for the win!

    Thanks guy.

    Rhino on
    93mb4.jpg
  • SporkAndrewSporkAndrew Registered User, ClubPA regular
    edited October 2007
    Rhino wrote: »
    Border=0 on the img tag for the win!

    Thanks guy.

    Oh dear God nooooooo!

    If you want to adhere to any standards whatsoever AND YOU SHOULD BE:
    a) the border element was depreceated in HTML4 and b) things should always be in quotes.

    So you want:
    <a href="blargh" title="View fullsize image or see something else">
             <img src="blargh" width="320" height="240" alt="describe the image here" style="border: 0;" />
    </a>
    

    (I've split things out a bit so it's easier to understand..)

    Start learning the right way to do things and you won't develop bad habits.

    Alternatively, what I always do is at the top of stylesheets set:
    img {
         border: 0;
    }
    

    And then explicitly set when I want a border. Saves having to put the style="border: 0" on every image that is also a link.

    SporkAndrew on
    The one about the fucking space hairdresser and the cowboy. He's got a tinfoil pal and a pedal bin
  • AndorienAndorien Registered User regular
    edited October 2007
    Rhino wrote: »
    Border=0 on the img tag for the win!

    Thanks guy.

    Oh dear God nooooooo!

    If you want to adhere to any standards whatsoever AND YOU SHOULD BE:
    a) the border element was depreceated in HTML4 and b) things should always be in quotes.

    So you want:

    <a href="blargh" title="View fullsize image or see something else">
             <img src="blargh" width="320" height="240" alt="describe the image here" style="border: 0;" />
    </a>
    
    (I've split things out a bit so it's easier to understand..)

    Start learning the right way to do things and you won't develop bad habits.

    Alternatively, what I always do is at the top of stylesheets set:
    img {
         border: 0;
    }
    
    And then explicitly set when I want a border. Saves having to put the style="border: 0" on every image that is also a link.

    Also, you'll probably want to stick the style code in an external CSS file. Apply that sucker to all your pages, and suddenly you can make sitewide style changes all at once.

    Andorien on
  • AftyAfty Registered User regular
    edited October 2007
    I was just going to lime that !

    It should be style="border:none;" though.

    Afty on
  • SporkAndrewSporkAndrew Registered User, ClubPA regular
    edited October 2007
    Afty wrote: »
    I was just going to lime that !

    It should be style="border:none;" though.

    As far as I know border: 0 and border: none both give the same results and are both CSS2 compliant. I just use border: 0 because it's 3 characters less.

    SporkAndrew on
    The one about the fucking space hairdresser and the cowboy. He's got a tinfoil pal and a pedal bin
  • AftyAfty Registered User regular
    edited October 2007
    From my mind if you put border:0; a border is still being drawn. with 0 width.

    If you put border:none; no border is drawn.

    Doubt it matters much, especially with modern browsers behaving (a little bit) better.

    Afty on
  • enderwiggin13enderwiggin13 Registered User regular
    edited October 2007
    I just want to thank you guys for helping people learn efficient and standard adherent code (seriously, no sarcasm).

    I can't stand seeing some of the code here at work (SQL, ASP, XHTML, XML). You would not believe the amount of bloat and waste and lack of comments. Why don't people use comments‽

    Anyways, sorry to derail but I wanted to commend learning it the right way the first time.

    enderwiggin13 on
    [SIGPIC][/SIGPIC]
  • AntishowAntishow Registered User regular
    edited October 2007
    Also, on the off chance that you only want to shut off borders for images that are inside of links:
    A IMG{
     border: none;
    }
    

    In general it's not such a great idea using the style attribute directly on the tag. By doing so you're effectively tying the presentation to the content, which is basically what css is supposed to prevent.

    Antishow on
  • LewishamLewisham Registered User regular
    edited October 2007
    I was giving him a quick thing to fix the immediate problem, I was working on the assumption that if the OP didn't care to Google the fix, he wasn't too fussed about reading CSS :)

    But yeah, classes are much better than style attributes.

    Lewisham on
  • RhinoRhino TheRhinLOL Registered User regular
    edited October 2007
    It's for testing.
    border=0 works.

    Rhino on
    93mb4.jpg
Sign In or Register to comment.