Get rid of border line around linked image

K

Kian

Hi,

When I add a link to a text, I know that I can get rid of "link underline"
by setting text-decoration="none" in CSS.

When I add a link to an image, how do I get rid of the "link border"? (Note:
The border doesn't exist before I add a link...)

Thanks,
Kian
 
I

Ivailo Chakarov

Why don't you try some old fashioned HTML

<img src="picture.jpg" border="0" />

That should do it.

Rgds

Ivo
 
K

Kian

Thanks Ivo.

I am thinking of doing something like the link to appear without any
decoration, but apply decoration when the mouse arrow hover it.

Regards,
Kian
 
D

Dylan Parry

Kian said:
Hi,

When I add a link to a text, I know that I can get rid of "link underline"
by setting text-decoration="none" in CSS.

This shoud be "text-decoration: none;"
When I add a link to an image, how do I get rid of the "link border"?
(Note: The border doesn't exist before I add a link...)

"border: 0px;" in your CSS.
 
W

William Starr Moake

Hi,

When I add a link to a text, I know that I can get rid of "link underline"
by setting text-decoration="none" in CSS.

When I add a link to an image, how do I get rid of the "link border"? (Note:
The border doesn't exist before I add a link...)
Add zero border width to image tag like this:
<img src="image.gif" width="200" height="200" border="0">
 
J

Jacqui or (maybe) Pete

....
I am thinking of doing something like the link to appear without any
decoration, but apply decoration when the mouse arrow hover it.
Best bet is to put a border around the img of the same color as the
background, and then change it on hover. That way things don't jump
around:

body {
background: fuchsia;
color: aqua;
}
a img { border: solid 3px fuchsia; }
a:hover img { border: solid 3px aqua; }

This is useful reading:

http://www.xs4all.nl/~wijnands/nnq/nquote.html
 
S

Sid Ismail

Thanks Ivo.

I am thinking of doing something like the link to appear without any
decoration, but apply decoration when the mouse arrow hover it.


Here's a trick for you: In your CSS stylesheet, have a:link, a:visited and
a:active set to text-decoration:none. a:hover to {color:yellow;} say.

Now your code
<a href="abc.html"><img src="alphabet.gif" height=80 width=80 border=0
alt="link to the alphabet"> </a>

Notice the space before </a>? Try it. :)

Sid
 
D

Dylan Parry

William said:

It doesn't require the px, that's true, but it doesn't make it invalid ;o)

Okay, so maybe "border: 0;" would be a better solution, but I still
stand with my first one :eek:P Incidently, is the "none" keyword a valid
value in this too? (border: 0 none;)
 
W

William Tasso

Dylan said:
It doesn't require the px, that's true, but it doesn't make it
invalid ;o)

I know, I know - just practice-picking class="nit"
Okay, so maybe "border: 0;" would be a better solution, but I still
stand with my first one :eek:P
;o)

Incidently, is the "none" keyword a valid
value in this too? (border: 0 none;)

why not? although it seems pointless - redundant even. but what about
{border: 0 none #f00;} any takers? I doubt I'll ever get round to testing
that.
 
D

David Dorward

Dylan said:
Okay, so maybe "border: 0;" would be a better solution, but I still
stand with my first one :eek:P Incidently, is the "none" keyword a valid
value in this too? (border: 0 none;)

border-width: 0;
border-style: none;
border-color: transparent;
 
B

brucie

^^^^^^^^^^^ invalid

no its not, i was looking at the wrong bit. but then i wonder why its
invalid for the longhand border color properties but valid for the
shorthand border properties.

'border-top-color', 'border-right-color', 'border-bottom-color',
'border-left-color'
Value: <color> | inherit

'border-color'
Value: <color>{1,4} | transparent | inherit

http://www.w3.org/TR/REC-CSS2/box.html#border-color-properties
 
D

David Dorward

brucie said:
In post <[email protected]>
David Dorward said...


^^^^^^^^^^^ invalid

Actually, it isn't.

From the spec:

'border-color'
Value: <color>{1,4} | transparent | inherit
Initial: see individual properties
Applies to: all elements
Inherited: no
Percentages: N/A
Media: visual

I seem to remember something about places for "transparent" to be added to
the list of colours for CSS 3, so it can be used anywhere a colour can be
used rather then just in specific places.
 
B

brucie

no its not, i was looking at the wrong bit. but then i wonder why its
invalid for the longhand border color properties but valid for the
shorthand border properties.

'border-top-color', 'border-right-color', 'border-bottom-color',
'border-left-color'
Value: <color> | inherit

'border-color'
Value: <color>{1,4} | transparent | inherit

http://www.w3.org/TR/REC-CSS2/box.html#border-color-properties

its fixed in the errata. i wish they would just change the f$*%ing
page.

http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html
 
S

Sid Ismail

I know, I know - just practice-picking class="nit"


Its like adding the ; at the end of a CSS definition. If you add to it, the
; is there. I also like 0px :)

Sid
 
M

mark | r

Dylan said:
Its like adding the ; at the end of a CSS definition. If you add to it, the
; is there. I also like 0px :)

Sid

a cool solution is

a img {border:0px;}

it makes all your image links borderless :) looks crap in dreamweaver tho.
mark
 
Joined
Nov 27, 2012
Messages
1
Reaction score
0
i recommend to just create a css style **** with the following properties

@charset "utf-8";
.noborders {
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
border-top-style: 0;
border-right-style: 0;
border-bottom-style: 0;
border-left-style: 0;
}

and just add it to all your images with links.

its easier this way if you are using dreamweaver but if you are a code huys just add border"0" to every image and that covers it

it looks like you are more like a css/dreamweaver guy good luck
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top