Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > border in a image link

Reply
Thread Tools

border in a image link

 
 
signo
Guest
Posts: n/a
 
      10-25-2005
Hello to everybody,
I'm trying to display a border when the mouse passes over an image that
has a link.
With IE6 everything is Ok, but with Mozilla only a portion of the
border is shown.
Does anybody know the reason why?
Thanks.

<STYLE type=text/css>
#nav A:hover {border:5px solid black}
</STYLE>

<div id="nav">
<a href="http://www.indirizzo.html">
<img src="mia_immagine.jpg">
</a>
</div>

 
Reply With Quote
 
 
 
 
Els
Guest
Posts: n/a
 
      10-25-2005
signo wrote:

> With IE6 everything is Ok, but with Mozilla only a portion of the
> border is shown.


> #nav A:hover {border:5px solid black}


It's because you are placing a border on the <a> element, instead of
on the image.
Change your style rule to:
#nav A:hover img {border:5px solid black}

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
 
Reply With Quote
 
 
 
 
Sid Ismail
Guest
Posts: n/a
 
      10-25-2005
On 25 Oct 2005 04:07:44 -0700, "signo" <(E-Mail Removed)>
wrote:

: Hello to everybody,
: I'm trying to display a border when the mouse passes over an image that
: has a link.
: With IE6 everything is Ok, but with Mozilla only a portion of the
: border is shown.
: Does anybody know the reason why?
: Thanks.
:
: <STYLE type=text/css>
: #nav A:hover {border:5px solid black}
: </STYLE>
:
: <div id="nav">
: <a href="http://www.indirizzo.html">
: <img src="mia_immagine.jpg">
: </a>
: </div>
:


Tr adding padding:3px in the style declaration

Sid


 
Reply With Quote
 
signo
Guest
Posts: n/a
 
      10-26-2005
I've found a solution: in this way it works well:

<style type="text/css">
#nav a {padding:5px; border:none; display:block; float:left}
#nav a:hover {padding:0; border:5px solid black}
#nav a img {border:none; display:block; margin:0}
</style>

<div id="nav">
<a href="http://www.indirizzo.html">
<img src="mia_immagine.jpg" /><span>Vai a indirizzo.html</span>
</div>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
border-color: #003366; border-width: 2px; =?UTF-8?B?TWFydGluIFDDtnBwaW5n?= HTML 64 07-30-2006 04:01 PM
Drop Down List Border Width vs Text Box Border Width Coder ASP .Net 1 06-24-2006 01:27 PM
row bottom border in inner table not matching up with row border in outer table phl HTML 1 06-08-2006 03:43 PM
css image link border and underline Steve Greenaway HTML 6 02-08-2005 03:37 PM
Datagrid Border showing when I say no border tshad ASP .Net 0 01-31-2005 05:40 PM



Advertisments