[thelist] simple css help

gruppenfreizeit postmeister at gruppenfreizeit.com
Sat Oct 29 03:53:01 CDT 2005


> Hello,
> try better this ;)
> <html>
> <head>
> <script type="text/javascript">
> function chgCol(obj,color1,color2)
> {
> obj.style.backgroundColor=color1;
> obj.style.color=color2;
> }
> </script>
> </head>
> <body>
> <table border="1" id="something">
> <tr>
> <a href="foo" id="link"><td onmouseover="chgCol(this,'black','white')"
> onmouseout="chgCol(this,'white','black')"><br /><br />Foo</a><br /><br
> /></td></a>
> <a href="foo" id="link"><td onmouseover="chgCol(this,'black','white')"
> onmouseout="chgCol(this,'white','black')"><br /><br />Foo</a><br /><br
> /></font></td></a>
> </tr>
> </table>
> </body></html>

Please tell me this is sarcasm...

Bad enough to use inline JavaScript for a _really_ easy CSS problem,
but nesting block elements in inline elements and using
deprecated/visual HTML is just making me want to upchuck. These are
hacks we unsuccessfully applied in 1998...

This is code that just cannot be fixed quickly, safely and cheaply. If
the client thinks they know how to do it, let them do it. Prove them
with examples that it does _not_ work and then bill them for a full
cleanup.

--
Chris Heilmann


Hello,

Sorry for the code you don't like. I don't like the br tags and the
misfunctionanlity in Mozilla either.
However, for my excuse, last week I used the same style to create a table
content in a temporary workaround
with W3C DOM createdElements and it work pretty good in IE and Mozilla.
I haven't tested with ns (the workaround was temporary).

a=doc.createElement("A");
a.setAttribute("href","foo");
td=doc.createElement("TD");
a.appendChild("td");
tbl.appendCild("a");

If you want the td activated together with the link in proper style, you
need at minimum an onclick event.
Highlited fields where the user has to click a few times and nothing happens
untill
he hits randomly the link text, makes him uncertain. Then it's better to
play with the link text only.

So far

gruppenfreizeit




More information about the thelist mailing list