I know I've done this before, but I simply can NOT think of the solution... Anyway, how do I get rid of the line around the images that are links?
Example: <a href="someotherpage.html"><img src="whateverimage.gif"></a>
TIA! - JACK D.
| SitePoint Sponsor |
I know I've done this before, but I simply can NOT think of the solution... Anyway, how do I get rid of the line around the images that are links?
Example: <a href="someotherpage.html"><img src="whateverimage.gif"></a>
TIA! - JACK D.





border="0"
as in:
<img src="image.gif" alt="alt text" height="32" width="32" border="0">
Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?
THANKS MUCH! - Jack D.
Alternatively, you could (and perhaps should*) push that kind of 'style' specification out to CSS.
Using the px is optional when the value is 0 as 0px = 0pt = 0em = 0.Code:img { border: 0px; }
Using CSS to control the border of images (including image links) is the XHTML Strict compliant method.
The image border attribute does not exist in XHTML Strict (though it does in Frameset and Transitional) as in that version of XHTML borders are expected to be specified in CSS not in the (X)HTML code.
*Of course, it' not yet essential to be 'Strictly' compliant, but becoming so now will get you into good habits that create code that is clean, well-formed and forward-compatible.
Just a thought![]()
New Plastic Arts: Visual Communication | DesignateOnline
Mate went to NY and all he got me was this lousy signature





You can always set the onclick of the image - if it's not
really an occasion that needs an anchor.
Flawless
---=| If you're going to buy a pet - get a Shetland Giraffe |=---
The problem with that is that you lose the pointer cursor when you mouseover it.Originally posted by Flawless_koder
You can always set the onclick of the image - if it's not
really an occasion that needs an anchor.
Flawless
This is still very important for letting the user know that it is actually a link.
The pointer cursor is such a commonly understood indicator for a link that if an image didn't turn the cursor to a pointer people might understandably assume that it isn't a link after all and not click it
IMage links don't always look like a button (logos for example).
Of course you can use CSS to 'fake' the pointer, but it is still much simpler at present to use the <a> tags to do the work for you.
It is presumably also better for SEs that will recognise it as a proper link.
New Plastic Arts: Visual Communication | DesignateOnline
Mate went to NY and all he got me was this lousy signature





You're not making it a "fake cursor" at all.
You're setting the cursor for the object - nothing fake about that at all.
When you do - for netscape users ( curse them ) use:
{
cursor: pointer;
cursor: hand;
}
Depending on how indepth your coding is there can be
numerous advantages to using this method rather than
an href tag ... maintaining a hierarchy of clicked
objects being one of the highest.
When you click on the child of the href - the child recieves
the src Attribute (currentTarget in Netscape).
This means that the object which initiated the event isn't
the event handler reference - an can lead to problems with
assumptions of nextSibling (etc) references.
Flawless
---=| If you're going to buy a pet - get a Shetland Giraffe |=---





And i wouldn't use this in examples where i'd be expecting
the SE to look at it.
For that the case is strong for using anchors.
Don't get me wrong - use anchors when you can... but
sometimes the situation does warrant an image.
The case discussed here might be such an occassion.
Flawless
---=| If you're going to buy a pet - get a Shetland Giraffe |=---
Bookmarks