Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Hyperlinking an Image

Reply
Thread Tools

Hyperlinking an Image

 
 
Daniel
Guest
Posts: n/a
 
      09-28-2007
In a table cell (with a background color) I inserted 2 times the same
transparent image (side by side). Everything appeared normal.

I now added a hyperlink to the images and a navy blue border appears
around each image. I would like to know how to remove the border and
all styling so that the images butt up against one another again.

Here is the code for that cell

<a href="http://localhost/web/insp_add.php?inspid=9">
<td class="conf" colspan="2" title="Time: 9:15
Duration: 2:15 hr(s)
Address: Montréal
Status: Confirmed">
<a href="http://localhost/web/insp_add.php?inspid=9">
<img src="images/inspreq.gif" width="10" height="10"
hspace="0" vspace="0" align="left"/>
</a>
<a href="http://localhost/web/insp_add.php?inspid=9">
<img src="images/inspreq.gif" width="10" height="10"
hspace="0" vspace="0" align="left"/>
</a>
</td>
</a>

I have tried the following in my css file

link {
margin: 20px;
padding: 0px;
border:none;
text-decoration:none;
}

a {
text-decoration:none;
border:none;
}

but it doesn't seem to do anything.

Thank you for your help,

Daniel

 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-28-2007
Daniel wrote:
> In a table cell (with a background color) I inserted 2 times the same
> transparent image (side by side). Everything appeared normal.
>
> I now added a hyperlink to the images and a navy blue border appears
> around each image. I would like to know how to remove the border and
> all styling so that the images butt up against one another again.
>
> Here is the code for that cell
>
> <a href="http://localhost/web/insp_add.php?inspid=9">
> <td class="conf" colspan="2" title="Time: 9:15
> Duration: 2:15 hr(s)
> Address: Montréal
> Status: Confirmed">
> <a href="http://localhost/web/insp_add.php?inspid=9">
> <img src="images/inspreq.gif" width="10" height="10"
> hspace="0" vspace="0" align="left"/>
> </a>
> <a href="http://localhost/web/insp_add.php?inspid=9">
> <img src="images/inspreq.gif" width="10" height="10"
> hspace="0" vspace="0" align="left"/>
> </a>
> </td>
> </a>
>
> I have tried the following in my css file
>
> link {
> margin: 20px;
> padding: 0px;
> border:none;
> text-decoration:none;
> }


Styling the LINK element eh? They have not visual styling they are
located in the HEAD portion of a document.

>
> a {
> text-decoration:none;
> border:none;
> }


What you want is:

/* IMGs that are a child of A, no border */
a img { border: 0; }


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
 
Daniel
Guest
Posts: n/a
 
      09-28-2007
First off, thank you!

Secondly, I'm (obviously) a novice at CSS. Could you point me to a
good website or 2 to learn from that cover this type of stuff in
detail and in plain english.

Thank you once again it was exactly what I needed.

Daniel

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-28-2007
Daniel wrote:
> First off, thank you!
>
> Secondly, I'm (obviously) a novice at CSS. Could you point me to a
> good website or 2 to learn from that cover this type of stuff in
> detail and in plain english.
>
> Thank you once again it was exactly what I needed.


We all started at one time.

Try tutorials at www.htmldog.com

Although not a great read, but very enlightening each time I refer to it...

http://www.w3.org/TR/CSS21/cover.html
Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification

I find the property index helpful:

http://www.w3.org/TR/CSS21/propidx.html
Full property table

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      09-28-2007
Scripsit Daniel:

> In a table cell (with a background color) I inserted 2 times the same
> transparent image (side by side). Everything appeared normal.


For some abnormal values of "normal".

> I now added a hyperlink to the images and a navy blue border appears
> around each image.


Is that your main concern, really? To prevent the user from getting the
slightest clue of there being a link?

> <a href="http://localhost/web/insp_add.php?inspid=9">
> <img src="images/inspreq.gif" width="10" height="10"
> hspace="0" vspace="0" align="left"/>
> </a>


That's particularly bad code - an img element without an alt attribute as a
link.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
John Hosking
Guest
Posts: n/a
 
      09-28-2007
Daniel wrote:
>
> Here is the code for that cell
>
> <a href="http://localhost/web/insp_add.php?inspid=9">
> <td class="conf" colspan="2" title="Time: 9:15
> Duration: 2:15 hr(s)
> Address: Montréal
> Status: Confirmed">
> <a href="http://localhost/web/insp_add.php?inspid=9">
> <img src="images/inspreq.gif" .../>
> </a>
> <a href="http://localhost/web/insp_add.php?inspid=9">
> <img src="images/inspreq.gif" .../>
> </a>
> </td>
> </a>


The validator accepts this as XHTML? A <td> inside an <a>?


--
John
Pondering the value of the UIP: http://improve-usenet.org/
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-28-2007
John Hosking wrote:
> Daniel wrote:
>>
>> Here is the code for that cell
>>
>> <a href="http://localhost/web/insp_add.php?inspid=9">
>> <td class="conf" colspan="2" title="Time: 9:15
>> Duration: 2:15 hr(s)
>> Address: Montréal
>> Status: Confirmed">
>> <a href="http://localhost/web/insp_add.php?inspid=9">
>> <img src="images/inspreq.gif" .../>
>> </a>
>> <a href="http://localhost/web/insp_add.php?inspid=9">
>> <img src="images/inspreq.gif" .../>
>> </a>
>> </td>
>> </a>

>
> The validator accepts this as XHTML? A <td> inside an <a>?
>
>


Wow! Or nested <a>'s I don't think so.....

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
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
Re: Hyperlinking and ASP.NEt Session Nedu N ASP .Net 5 09-07-2006 08:15 AM
Hyperlinking folders and or files in an xls file lafftrax Computer Support 1 12-24-2004 07:57 PM
Hyperlinking folders and or files in an xls file thumbs Computer Support 0 12-24-2004 05:10 PM
hyperlinking to a new page Gmansky ASP .Net 1 06-27-2004 05:52 AM
Hyperlinking and ASP.NEt Session Nedu N ASP .Net Building Controls 5 12-09-2003 10:08 PM



Advertisments