Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2006, 08:59 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default place anchor tag around bgImage inside cell??

Can you place an anchor tag around a bgImage inside a table cell?

NOTE: I do not want to place the image inside the cell. I need to write a database value inside the cell. The BGImage is a design feature surrounding the text. The text is to be a link however I have placed a title="some text" inside the <td> saying click here - therefore would like any area of the cell to be clickable - Is this possible?

To Illustrate (excuse the ASP in the HTML area)
<tD width="106" height="20"
<% if (cint(session("groupID")) = -1) then %>
     title="Log-in to access <%= getInfo(1) %>" class="boldTdDimmed" background="<%= URLBase %>Images/buttonGroup110x20Inactive.gif"
<% elseif (cint(session("groupID")) = 0) then %>
     title="Click to enter <%= getInfo(1) %>" class="boldTd" background="<%= URLBase %>Images/buttonGroup110x20.gif"
<% else
     if (cint(session("groupID")) = cint(getInfo(0))) then %>
         title="Click to enter <%= getInfo(1) %>" class="boldTd" background="<%= URLBase %>Images/buttonGroup110x20.gif"
<% else %>
         title="You may not enter the <%= getInfo(1) %> area" class="boldTdDimmed" background="<%= URLBase %>Images/buttonGroup110x20Inactive.gif"
<% end if
    end if %>
align="center"><img src="<%= URLBase %>Images/ts.gif" width="106" height="1" alt="" border=""><br><%= getInfo(1) %></tD>

TYIA

Wind is your friend
Matt
__________________
Wind is your friend
Matt
 
Old January 25th, 2006, 04:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

[quote]Originally posted by mat41
 Can you place an anchor tag around a bgImage inside a table cell?

No. You can use a background image with a link though and you can make the link fill the whole TD. Look at yhe CSS property 'display: block'.



--
http://yupapa.com
 
Old January 25th, 2006, 09:46 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Cheers for your reply

When I say anchor tag my objective is to create a link.

This is what the description of 'Display' is:
"The display property sets how/if an element is displayed."

And the 'block' property:
"The element will be displayed as a block-level element, with a line break before and after the element.

Ref: http://www.w3schools.com/css/pr_class_display.asp

Doesnt look like a solution to me. Have you used this before??

Anyone else??

TYIA

Wind is your friend
Matt
 
Old January 26th, 2006, 03:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Yes, of course I have. It's the only way you can make it so a background image *seems to be* linked. Did you try it? Trying is crucial, you know.

--
http://yupapa.com
 
Old January 26th, 2006, 07:42 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Yes I did and it didnt however it seems to be now, thanking you kindley.

For anybody looking for this solution place the code in the hover style:
a:hover {color: #99CC00;display: block; text-decoration: none;}

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Anchor Tag kapilmirchi ASP.NET 1.0 and 1.1 Basics 2 November 18th, 2008 05:57 AM
Anchor tag visited CSS related question mat41 Classic ASP Basics 0 April 16th, 2008 05:55 PM
Want to pass value at href in anchor tag on xslt Abhinavnaresh XSLT 4 February 21st, 2008 04:32 AM
Problem with input type image With Anchor tag vinkumrect Javascript How-To 1 July 21st, 2005 08:59 AM
Javascript in Anchor Tag jamara JSP Basics 1 May 30th, 2005 01:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.