http://www.perlmonks.org?node_id=487254


in reply to More ways to download code...

BTW, personally I'd like it if the link were closer to the code block vertically, but I haven't quite worked out how to do it, as it seems to vary anyway, at least in Firefox anyway.
Can you put the code block and the d/l link in a table so they're side by side? or does that cause problems with the code wrapping?
# current: <pre><tt class="code"><font size="-1">my $message=&quot;Hello world\n& +quot;; print $message; </font></tt></pre><div class='embed_code_dl'><a href="?part=1;abspart= +1;displaytype=displaycode;node_id=487248">(d/l)</a></div> # like this? <table cellpadding="0" cellspacing="0" border="0"><tr><td> <pre><tt class="code"><font size="-1">my $message=&quot;Hello world\n& +quot;; # adding filler lines # adding filler lines # adding filler lines print $message; </font></tt></pre> </td><td valign="bottom"> <div class='embed_code_dl'><a href="?part=1;abspart=1;displaytype=disp +laycode;node_id=487248">(d/l)</a></div> </td></tr></table>
Not sure what the valign should be by default.. i think you can equally argue for all 3.


Or even like this (but requires changing "dev.embed_code_dl" in the style sheet to be ".embed_code_dl" or "td.embed_code_dl"). Note that the valign should be added to the embed_code_dl class as well.
<table cellpadding="0" cellspacing="0" border="0"><tr> <td><pre><tt class="code"><font size="-1">my $message=&quot;Hello worl +d\n&quot;; # adding filler lines # adding filler lines # adding filler lines print $message; </font></tt></pre></td> <td class='embed_code_dl'><a href="?part=1;abspart=1;displaytype=displ +aycode;node_id=487248">(d/l)</a></td> </tr></table>

Update: hmm.. i think if the above is done, that multiple "(d/l)" links on a node (for example 487227) won't be aligned horizontally (i.e. all directly above each other) unless a td width for the left cell is specified...