Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Link Address Visibility

Reply
Thread Tools

Link Address Visibility

 
 
Roy Schestowitz
Guest
Posts: n/a
 
      07-30-2005
Is there a CSS-driven way of diplaying the link address near links (without
the use of JavaScript)? Is there a CSS hack of some sort? I would like to
embed full URL's near the links in a printable version of a page (and in a
printed version links cannot be followed).

Thanks very much in advance even if the answer is no... I am willing to use
JS if there is no alternative.

Roy
 
Reply With Quote
 
 
 
 
Els
Guest
Posts: n/a
 
      07-30-2005
Roy Schestowitz wrote:

> Is there a CSS-driven way of diplaying the link address near links (without
> the use of JavaScript)? Is there a CSS hack of some sort? I would like to
> embed full URL's near the links in a printable version of a page (and in a
> printed version links cannot be followed).
>
> Thanks very much in advance even if the answer is no... I am willing to use
> JS if there is no alternative.


Not sure if this is what you're after, but I'd just write the html
like this:
<a href="linkaddress">linktext<span> linkaddress</span></a>
and in the CSS for screen:
a span{display:none;}
in CSS for print:
a span{display:inline;}


--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -
 
Reply With Quote
 
 
 
 
Roy Schestowitz
Guest
Posts: n/a
 
      07-30-2005
Els wrote:

> Roy Schestowitz wrote:
>
>> Is there a CSS-driven way of diplaying the link address near links
>> (without the use of JavaScript)? Is there a CSS hack of some sort? I
>> would like to embed full URL's near the links in a printable version of a
>> page (and in a printed version links cannot be followed).
>>
>> Thanks very much in advance even if the answer is no... I am willing to
>> use JS if there is no alternative.

>
> Not sure if this is what you're after, but I'd just write the html
> like this:
> <a href="linkaddress">linktext<span> linkaddress</span></a>
> and in the CSS for screen:
> a span{display:none;}
> in CSS for print:
> a span{display:inline;}


That is an excellent idea, but it involves re-writing the content (about 400
pages in this case) to include <span> elements. I once wrote a
global/recursive search-and-replace tool for Linux, but it operates on
files, not on a database, which is where all the data is located. If I got
an sqldump, I can't think of a simple rule to mass-replace e.g.

<a href="TOKEN">link name</a>

<a href="TOKEN">link name<span> TOKEN</span></a>

I know it is possible, but it is not trivial to implement.

Roy

--
Roy S. Schestowitz
http://Schestowitz.com
 
Reply With Quote
 
Spartanicus
Guest
Posts: n/a
 
      07-30-2005
Roy Schestowitz <(E-Mail Removed)> wrote:

>Is there a CSS-driven way of diplaying the link address near links (without
>the use of JavaScript)? Is there a CSS hack of some sort?


Proper CSS, no "hack":

@media print{
a:after{content: " <"attr(href)">"}
}

Does not work in IE due to poor CSS support.

>I would like to
>embed full URL's near the links in a printable version of a page (and in a
>printed version links cannot be followed).


I'd rethink that strategy, it tends to make a mess of printed pages and
the functionality offered is most questionable.

--
Spartanicus
 
Reply With Quote
 
Els
Guest
Posts: n/a
 
      07-30-2005
Roy Schestowitz wrote:

> Els wrote:
>
>> Roy Schestowitz wrote:
>>
>>> Is there a CSS-driven way of diplaying the link address near links
>>> (without the use of JavaScript)? Is there a CSS hack of some sort? I
>>> would like to embed full URL's near the links in a printable version of a
>>> page (and in a printed version links cannot be followed).
>>>
>>> Thanks very much in advance even if the answer is no... I am willing to
>>> use JS if there is no alternative.

>>
>> Not sure if this is what you're after, but I'd just write the html
>> like this:
>> <a href="linkaddress">linktext<span> linkaddress</span></a>
>> and in the CSS for screen:
>> a span{display:none;}
>> in CSS for print:
>> a span{display:inline;}

>
> That is an excellent idea, but it involves re-writing the content (about 400
> pages in this case) to include <span> elements. I once wrote a
> global/recursive search-and-replace tool for Linux, but it operates on
> files, not on a database, which is where all the data is located. If I got
> an sqldump, I can't think of a simple rule to mass-replace e.g.
>
> <a href="TOKEN">link name</a>
>
> <a href="TOKEN">link name<span> TOKEN</span></a>
>
> I know it is possible, but it is not trivial to implement.


I think it's pretty trivial for anyone fluent in regular expressions.
i.e. not me

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -
 
Reply With Quote
 
Roy Schestowitz
Guest
Posts: n/a
 
      07-30-2005
Spartanicus wrote:

> Roy Schestowitz <(E-Mail Removed)> wrote:
>
>>Is there a CSS-driven way of diplaying the link address near links
>>(without the use of JavaScript)? Is there a CSS hack of some sort?

>
> Proper CSS, no "hack":
>
> @media print{
> a:after{content: " <"attr(href)">"}
> }



That's excellent!


> Does not work in IE due to poor CSS support.



The most common browser on my site is Mozilla Firefox (based on ~35k
visits/month). I already use some :before and :after elements. If they get
neglected, nothing is lost


>>I would like to
>>embed full URL's near the links in a printable version of a page (and in a
>>printed version links cannot be followed).

>
> I'd rethink that strategy, it tends to make a mess of printed pages and
> the functionality offered is most questionable.



When I think about it, long links (of which I tend to have some) will cause
problems indeed, much as they do in UseNet. I think I'll go ahead anyway...
maybe down-scaling link text once it becomes an issue...

Many thanks,

Roy

--
Roy S. Schestowitz
http://Schestowitz.com
 
Reply With Quote
 
Roy Schestowitz
Guest
Posts: n/a
 
      07-30-2005
Roy Schestowitz wrote:

> Spartanicus wrote:
>
>> Roy Schestowitz <(E-Mail Removed)> wrote:
>>
>>>Is there a CSS-driven way of diplaying the link address near links
>>>(without the use of JavaScript)? Is there a CSS hack of some sort?

>>
>> Proper CSS, no "hack":
>>
>> @media print{
>> a:after{content: " <"attr(href)">"}
>> }

>
>
> That's excellent!
>
>
>> Does not work in IE due to poor CSS support.

>
>
> The most common browser on my site is Mozilla Firefox (based on ~35k
> visits/month). I already use some :before and :after elements. If they get
> neglected, nothing is lost
>
>
>>>I would like to
>>>embed full URL's near the links in a printable version of a page (and in
>>>a printed version links cannot be followed).

>>
>> I'd rethink that strategy, it tends to make a mess of printed pages and
>> the functionality offered is most questionable.

>
>
> When I think about it, long links (of which I tend to have some) will
> cause problems indeed, much as they do in UseNet. I think I'll go ahead
> anyway... maybe down-scaling link text once it becomes an issue...



You were actually right. It affect more than you want it to...

http://www.schestowitz.com/Weblog/in...nter.php?p=384

All <a id/name> get an empty address bound to them. Titles become obscure
and the whole structure gets messed up. It was worth trying though...
 
Reply With Quote
 
Spartanicus
Guest
Posts: n/a
 
      07-30-2005
Roy Schestowitz <(E-Mail Removed)> wrote:

>>> @media print{
>>> a:after{content: " <"attr(href)">"}
>>> }

>
>All <a id/name> get an empty address bound to them.


That you could fix:

@media print{
a[href]:after{content: " <"attr(href)">"}
}

>Titles become obscure
>and the whole structure gets messed up. It was worth trying though...


I've tried it myself, as you noted the length of the urls was a problem,
"in-paragraph" links really mess up the readability of the content, but
the main reason why I ditched it was that on reflection it didn't
provide any real function for users. People don't expect an ability to
retrieve links from printed pages, and few would be willing to type in
the urls manually anyway.

--
Spartanicus
 
Reply With Quote
 
Roy Schestowitz
Guest
Posts: n/a
 
      07-30-2005
Spartanicus wrote:

> Roy Schestowitz <(E-Mail Removed)> wrote:
>
>>>> @media print{
>>>> a:after{content: " <"attr(href)">"}
>>>> }

>>
>>All <a id/name> get an empty address bound to them.

>
> That you could fix:
>
> @media print{
> a[href]:after{content: " <"attr(href)">"}
> }



Thanks, I'll do that.


>>Titles become obscure
>>and the whole structure gets messed up. It was worth trying though...

>
> I've tried it myself, as you noted the length of the urls was a problem,
> "in-paragraph" links really mess up the readability of the content, but
> the main reason why I ditched it was that on reflection it didn't
> provide any real function for users. People don't expect an ability to
> retrieve links from printed pages, and few would be willing to type in
> the urls manually anyway.


If you use Firefox (in which case the "after" gets picked up) or another
proper browser, go to Print Preview and see why I'm worried and having
second thoughts. I don't expect people to print pages though; it is a
"proof of concept" rather, which I hope the WordPress community will pick
up on.

Cheers,

Roy

--
Roy S. Schestowitz
http://Schestowitz.com
 
Reply With Quote
 
Robert Frost-Bridges
Guest
Posts: n/a
 
      07-30-2005
Roy Schestowitz wrote:

> If you use Firefox (in which case the "after" gets picked up) or another
> proper browser, go to Print Preview and see why I'm worried and having
> second thoughts. I don't expect people to print pages though; it is a
> "proof of concept" rather, which I hope the WordPress community will pick
> up on.


Surely Els suggestion fits best for a proof of concept then. I think you did
acknowledge that as an excellent idea but the fact that 400+ pages would
need updating, but if it's the right way then that's what you need to do,
even if it is time consuming.

--
Robert
http://brightonfixedodds.net

 
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
Visibility of link button =?Utf-8?B?Ym9iYnk=?= ASP .Net 3 09-17-2007 09:20 PM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM
Netwok Visibility Dennis Jelavic Wireless Networking 8 02-15-2005 04:34 AM
Visibility of enumeration literals under use clauses biau@altavista.com VHDL 15 02-01-2005 04:19 AM



Advertisments