|
Posted by ii2o on January 23, 2005, 2:02 pm
Please log in for more thread options
Hi guys,
I have a problem where IE is refusing tables to made as hyperlinks. I
have some CSS code which makes the background glow if is hovered upon
and this works fine both in Firefox and IE. However, if you try
clicking on the link that it points to, it redirects in Firefox but not
in IE. I have included a stripped down version of the code below and I
would be greatly appreciative if someone could help me out, or suggest
an alternative to achieve the same effect.
Also, notice how the correct URL is shown in IE's status bar so I'm
pretty sure the code is *almost* correct.
Thanks,
ii2o
------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<style type="text/css">
body {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
background-color: #000000;
}
..heading1 {
font-weight: bold;
color: #663333;
border-color: #663333;
line-height: 140%;
text-decoration: none;
}
#main {
position: absolute; left: 4px; top: 79px;
padding : 2px;
overflow: auto;
border : solid 1px #444444;
}
..menuitem a {
display:block;
background-color:#000000;
color:#FFFFFF;
text-decoration:none;
border-width : 1px;
border-style:solid;
border-color:#000000;
}
..menuitem a:hover {
background-color:#333333;
color:#FFFFFF;
text-decoration:none;
border: 1px solid #663333;
}
..menuitem a:visited {
color:#FFFFFF;
}
</style>
</head>
<body>
<div id="main" style="width : 360px; height : 250px;">
<div class="menuitem" style="width : 342px">
<a href="http://www.bbc.co.uk"> <table width="342" border="0">
<tr>
<td valign="middle" width="40"><img class="heading1"
src="http://newsimg.bbc.co.uk/media/images/40749000/jpg/_40749725_abbas203indap.jpg" width="40" height="40" border="1"></td>
<td width="280">
<span class="heading1">01234 - 56789</span><br />
abcde - fghijk
</td>
<td valign="center" width="20"><img class="heading1"
src="http://newsimg.bbc.co.uk/media/images/40749000/jpg/_40749725_abbas203indap.jpg" width="20" height="20" border="1">
</td>
</tr>
</table>
</a>
</div>
<div class="menuitem" style="width : 342px">
<a href="http://www.bbc.co.uk/sport"> <table width="342" border="0">
<tr>
<td valign="middle" width="40"><img class="heading1"
src="http://newsimg.bbc.co.uk/media/images/40752000/jpg/_40752243_berg_pa_203.jpg" width="40" height="40" border="1"></td>
<td width="280">
<span class="heading1">blah - blah</span><br />
text - here
</td>
<td valign="center" width="20"><img class="heading1"
src="http://newsimg.bbc.co.uk/media/images/40752000/jpg/_40752243_berg_pa_203.jpg" width="20" height="20" border="1">
</td>
</tr>
</table>
</a>
</div>
</div>
</body>
</html>
|
|
Posted by Mark Parnell on January 24, 2005, 10:10 am
Please log in for more thread options
Previously in comp.infosystems.www.authoring.html, ii2o
> I have a problem
http://validator.w3.org/
--
Mark Parnell
http://www.clarkecomputers.com.au
|
|
Posted by ii2o on January 23, 2005, 3:29 pm
Please log in for more thread options Okay...... I guess I can't put tables inside an <a href> tag. How can I
get around this using DIV's because when I replace the three table
cells with DIV tags, it keeps putting each DIV on a new line - why
won't it let me put all three adjacent to each other?
|
|
Posted by Mark Parnell on January 24, 2005, 10:54 am
Please log in for more thread options Previously in comp.infosystems.www.authoring.html, ii2o
> Okay...... I guess I can't put tables inside an <a href> tag.
Correct. An anchor cannot contain any block-levet element. It must be
the other way around. (Besides, making an entire table a link is
illogical).
> How can I
> get around this using DIV's
You can't. As I said above, an anchor cannot contain a block-level
element. Why not describe what you are actually trying to do, rather
than the perceived solution? Then we might be able to help.
--
Mark Parnell
http://www.clarkecomputers.com.au
|
|
Posted by ii2o on January 23, 2005, 4:39 pm
Please log in for more thread options Hi,
Well i'll try my best to describe (but if you'd like to see what I'd
like to achieve then copy the code into an htm file and run it because
everything works in it except the link can't be clicked), but I'd like
a list of items, where each item has a 40 x 40 picture to the left, 2
lines of text in the center, and a smaller 20 x 20 image to the right.
When you hover over the item, I'd like the background to change colour,
and the whole item to be surrounded by a border. Also, clicking
anywhere on the item should take the user to the link specified by the
a href tag.
Thanks,
ii2o
|
| Similar Threads | Posted | | Problems with tables and layout in Firefox | January 4, 2006, 11:01 pm |
| Padding Attribute for Tables and IE Problems | September 6, 2006, 2:51 pm |
| hyperlinks question | July 21, 2004, 8:07 pm |
| help with url hyperlinks (question) | February 22, 2005, 6:04 pm |
| Two Questions on Link REL/REV and dead-end hyperlinks. | December 19, 2005, 11:20 pm |
| HTML4.01 STRICT and hyperlinks with target | October 8, 2008, 4:26 am |
| Re: HTML4.01 STRICT and hyperlinks with target | October 8, 2008, 5:14 pm |
| hyperlinks to jpeg image fail on new server | December 2, 2007, 6:51 am |
| Why do 100% tables not go to 100%? | September 23, 2004, 10:24 am |
| tables ;-( | September 26, 2005, 11:38 pm |
|