473,387 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

image in tagged text

Hi,
I want to indicate external links on my site with an image at the end of the
URL, and if possible I'd want to include it in a class, like

<a class="extlink" href="http://www.someexternallink.com">The external
link</a>

Which should be rendered as "The external link [o]", where [o] is the image.
Of course I could write it as

<a href="http://www.someexternallink.com">The external link <img
source="/images/extlink.png" alt=""
class="makesuretheimageiscorrectlyalignedwiththete xt" /></a>

but I was wondering if I could do it with the former.
TIA

Steven
Aug 3 '05 #1
8 1431
steven <st***************@telenet.be> wrote:
I want to indicate external links on my site with an image at the end of the
URL, and if possible I'd want to include it in a class, like

<a class="extlink" href="http://www.someexternallink.com">The external
link</a>

Which should be rendered as "The external link [o]", where [o] is the image.


In theory, you could use generated content. In practice, support is poor.

A technique that has better support is to specify a non-repeating
background image positioned on the right, with corresponding padding on the
right to keep the link text off the image.

FWIW, CSS3 selectors may eventually allow you to skip the CLASS attribute.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"Shin: a device for finding furniture in the dark." - Steven Wright
Aug 3 '05 #2
Darin McGrew:
steven <st***************@telenet.be> wrote:
"The external link [o]", where [o] is the image.
In theory, you could use generated content. In practice, support is poor.


Depends on your definition of poor, because it works in all major
browsers except IE.
A technique that has better support is to specify a non-repeating
background image positioned on the right, with corresponding padding
That makes ugly gaps with CSS on, images off.
FWIW, CSS3 selectors may eventually allow you to skip the CLASS attribute.


[href^="http://"]

and similar are not very reliable, because a link that begins like that
doesn't have to be external and vice versa. Some use "rel='external'".
Aug 3 '05 #3
steven <st***************@telenet.be> wrote:
"The external link [o]", where [o] is the image.

I wrote: In theory, you could use generated content. In practice, support is poor.
Christoph Päper <cr*****@gmx.net> wrote:
Depends on your definition of poor, because it works in all major
browsers except IE.
Okay. Browser support is good. Browser-like OS component support is poor.

Better? :-)
A technique that has better support is to specify a non-repeating
background image positioned on the right, with corresponding padding That makes ugly gaps with CSS on, images off.
Good point. Thanks.
FWIW, CSS3 selectors may eventually allow you to skip the CLASS attribute.

[href^="http://"]

and similar are not very reliable, because a link that begins like that
doesn't have to be external and vice versa. Some use "rel='external'".


You could turn on the effect for such non-relative links:

[href^="http://"]

And then turn off the effect for your own site:

[href^="http://www.example.com"]

Or am I missing something?
--
Darin McGrew, da***@TheRallyeClub.org, http://www.TheRallyeClub.org/
A gimmick car rallye is not a race, but a fun puzzle testing your
ability to follow instructions. Upcoming gimmick car rallye in
Silicon Valley: A Series of Unfortunate Events (Saturday, September 3)
Aug 3 '05 #4
Christoph Päper <ch**************@nurfuerspam.de> wrote:

[indicating external links]
A technique that has better support is to specify a non-repeating
background image positioned on the right, with corresponding padding


That makes ugly gaps with CSS on, images off.


For this purpose generated content is also flawed, it fails with css
off, if an icon is used a browser may display something silly like
"image" when images are off, or worse nothing at all.

This should be coded as real content, for example with a graphic icon
and by supplying alt and title content.

--
Spartanicus
Aug 4 '05 #5
Spartanicus:
[indicating external links]

This should be coded as real content,


Actually it shouldn't be indicated at all, IMO.

FWIW, you can give fallback text for images in generated content, too,
IIRC. I know some people who use arrows, which are "uniencoded".
Aug 4 '05 #6
Christoph Päper <ch**************@nurfuerspam.de> wrote:
[indicating external links]

This should be coded as real content,
Actually it shouldn't be indicated at all, IMO.


Your opinion is at odds with the opinion of usability and UI experts.
FWIW, you can give fallback text for images in generated content, too,
IIRC. I know some people who use arrows, which are "uniencoded".


With CSS2.x? How?

--
Spartanicus
Aug 4 '05 #7
Spartanicus:
Christoph Päper <ch**************@nurfuerspam.de> wrote:
[indicating external links]


Actually it shouldn't be indicated at all, IMO.


Your opinion is at odds with the opinion of usability and UI experts.


Which ones? Most I know even consider underlining links too distractive,
i.e. colouring should be enough. You could try to introduce a different
colour value for "external" links---that concept is fairly
arbitrary---and maybe even one for visited external links, but there is
no de facto standard for that, unlike the blue and purple of general
links. (Wikipedia and related projects do this for example, but
inter-project links are considered "local" there, despite various
(sub-)domain names.) Therefore you cannot count on the recognizability
of it, which you cannot with images or symbols either.

Whether a link is considered internal or external is often arguable and
should be clear to the reader from the context.
FWIW, you can give fallback text for images in generated content, too,
IIRC. I know some people who use arrows, which are "uniencoded".


With CSS2.x? How?


a[rel~="external"]:after {content: "\2197"; content: url("ext.gif");}

but CSS 2.1 says about <uri>:

| If a user agent cannot display the resource it must ignore it.

It doesn't say it must ignore the rule, which would invoke the preceding
rule. The above fallback should at best work for browsers that don't
support anything but text in generated content (e.g. Opera 5--6 IIRC).
It seems I had some CSS3 proposal or draft in mind, where the above or

a[rel~="external"]:after {content: url("ext.gif"), "\2197";}

was allowed.
PS: I left out the problem, that the knowledge about blue and purple
links is fading among beginners, because of increasing misguided
use of CSS.
Aug 4 '05 #8
Christoph Päper <ch**************@nurfuerspam.de> wrote:
[indicating external links]

Actually it shouldn't be indicated at all, IMO.


Your opinion is at odds with the opinion of usability and UI experts.


Which ones?


The Essential Guide to User Interface Design: An Introduction to GUI
Design Principles and Techniques, Second Edition 2002
by Wilbert O. Galitz

Beasley, R. and Waugh, M. (1997). Predominant Initial and Review Pattern
Navigation in a Fully Constrained Hypermedia Hierarchy: An Empirical
Study (11 Aug. 1997)

Ellis, R.D. and Kurniawan, S.H. (2000). Increasing the usability of
online information for older users: A case study in participatory
design, International Journal of Human-Computer Interaction, 12
(2)263276.

--
Spartanicus
Aug 4 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mikea_59 | last post by:
I would like to use XSLT to translate some tagged value text to XML elements like this: Input Doc: <data>x=1.234 y=ABC z="Hello World"</data> Output Doc: <x>1.234</value>
7
by: Dobedani | last post by:
Dear All, I am developing / maintaining a web application which generates GIF images on the fly. When I send the image, I make sure a header is sent first with MIME-type image/gif. My HTML-code...
4
by: Brian Wilson | last post by:
Hi Newsgroup! I know many of you must have bought the Access Developer's Handbook and used the Tagged Values class, so perhaps I can ask someone to check something. On page 303, it describes the...
10
by: ste | last post by:
Hi there, I'm trying to query a MySQL database (containing image data) and to output the results in a HTML table of 3 columns wide (and however many rows it takes) in order to create a basic...
0
by: info | last post by:
For fingerprint images WSQ (Wavelet Scalar Quantization) is superior to other lossy compression methods, such as JPEG, and was chosen by FBI (U.S. Federal Bureau of Investigation) as the...
7
by: Johan Tibell | last post by:
I use a tagged union to represent different expression types in one of my programs. struct exp { enum { LIT, VAR } type; union { int lit;
1
by: dangier | last post by:
I have an Access 2003 table with an XML field that is tagged as follows: <Calendar CompactMode="1"><CustomProperties><CustomProperty Name="startdate" Value="3/26/2007"...
1
by: Pedro Rosas Silva | last post by:
Hi everyone, Is anybody aware of a way how to insert an image in a WordML document programmatically, through C#? I have a C# application that loads into memory a WordML document...
12
by: lawpoop | last post by:
I'm developing a php website that I have under subversion version control. I'm working on an image upload functionality, and in the middle of it I realized that any files that a user uploads will...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.