styled text substitute for a picture that fails to load...

D

dorayme

Anyone know if there is a simple way or a way to have some
/styled/ text appear if a graphic image fails (by accident or
intention) to load? I know text appears via the alt tag for
example, but I mean styled like an <h1> is or can be...

.--. |V|
/ \ _| /
q .. p \ /
\--/ //
__||__//
/. _/
// \ /
// ||
\\ / \
)\| |
/ || || |
|/\| || |
| || |
\ || /
__/ || \__
\____/\____/

dorayme

(An earthling, not me, did this... hope it does not break up
bad?)
 
M

Mark Parnell

Anyone know if there is a simple way or a way to have some
/styled/ text appear if a graphic image fails (by accident or
intention) to load?

Apply the styles as you normally would (note: must be applied to the
containing element, not the image itself - wrap the image in e.g. <span
class="image">...</span> if necessary).

E.g.:
span.image {font-size: 2em; color: #FF0000; background-color: #0099FF;}

Firefox at least displays the alt text styled. It still displays the
border around it to show it was supposed to be an image though.
I know text appears via the alt tag

*attribute* :)
 
D

dorayme

From: Mark Parnell said:
dorayme


Apply the styles as you normally would (note: must be applied to the
containing element, not the image itself - wrap the image in e.g. <span
class="image">...</span> if necessary).

E.g.:
span.image {font-size: 2em; color: #FF0000; background-color: #0099FF;}

Firefox at least displays the alt text styled. It still displays the
border around it to show it was supposed to be an image though.

Yes, thanks. All my old browsers "respond" to this (I have only
tried it with inline styles as a quick test of your suggestion),
but my Mozilla 1.3.1 does it more as the style is intended (ie.
it works in my Mozilla best).

My images almost never fail to appear but I am thinking it would
be a nice touch to guard against the possibility.
*attribute* :)

Oops, yes! You perhaps do not know or, more likely, are too polite to
say, that this is at least the second time I have made this slip!


dorayme

I will see how it looks on the PC browsers and with proper
separate style sheets... when I come back from my late afternoon
swim - for those in miserable cold climes, my apologies.
Basically, to labour the point, I go to a sort of Paradise most
days even in winter. I am really sorry, but it is the privilege
of visitors from outer space to choose where on earth they want
to be...
 
T

Toby Inkster

dorayme said:
Anyone know if there is a simple way or a way to have some
/styled/ text appear if a graphic image fails (by accident or
intention) to load?

That's the idea of the <object> element:

<object type="image/jpeg" data="blah.jpeg" height="120" width="180">
<p>Alternative text goes here. It can use <i>italics</i> or
<b>bold</b> or whatever you want. You might want to offer a <a
href="blah.jpeg">link to the image</a> so that people can download
it for viewing in a standalone image viewer if their browser doesn't
support images.</p>
</object>

However, although <object> itself is well-supported in most browsers, many
still have problems correctly dealing with the alternative content.

XHTML 2.0 will be cool in that you won't really need the <img/> element.
Any element can be used to display an image. e.g. instead of:

<h1><img src="banner.jpeg" alt="Heading"/></h1>

you'd use:

<h1 src="banner.jpeg">Heading</h1>
 
D

dorayme

From: Toby Inkster said:
That's the idea of the <object> element:

<object type="image/jpeg" data="blah.jpeg" height="120" width="180">
<p>Alternative text goes here. It can use <i>italics</i> or
<b>bold</b> or whatever you want. You might want to offer a <a
href="blah.jpeg">link to the image</a> so that people can download
it for viewing in a standalone image viewer if their browser doesn't
support images.</p>
</object>

However, although <object> itself is well-supported in most browsers, many
still have problems correctly dealing with the alternative content.

XHTML 2.0 will be cool in that you won't really need the <img/> element.
Any element can be used to display an image. e.g. instead of:

<h1><img src="banner.jpeg" alt="Heading"/></h1>

you'd use:

<h1 src="banner.jpeg">Heading</h1>

Yes, that would be neat.

I made some experiments and offline the object construct was
best on some of my browsers but things are different and more
complex online! Online, my best browser the Mozilla, renders the
<h1> or <span> best... my main criterion being the /absence/ of
the rectangle (from the img specs), all else like bg and width
can be accounted for, but the rect can only be rid of by leaving
out the specs (I don't like doing this, but I suppose it is a
thought for the occasional pictured heading)...

You can see a test page at http://dorayme.150.com/test.html (I
include the last in the list with same bg as the page (my
preferred practice for most headings, even the rare pictured
ones), this looked the best to me off line, but not online.
Anyway it is too complicated for now, I would need to make
screen shots to show you what I see... For now it seems that a
span or h1 is best for online - on the evidence of my eyes. I
started out this post saying things like "Yes, the object
element is the go..." till I tried online. Maybe that server is
lousy? Will try others...

I will take a look on Windows browsers when I can...

Don't anyone worry about all this too much...it is not any kind
of urgent problem. No wonder pharmeceutical drugs cost so much,
testing anything seems to take up enormous quantities of time.

dorayme
 
N

Neredbojias

With neither quill nor qualm, dorayme quothed:
Yes, that would be neat.

I made some experiments and offline the object construct was
best on some of my browsers but things are different and more
complex online! Online, my best browser the Mozilla, renders the
<h1> or <span> best... my main criterion being the /absence/ of
the rectangle (from the img specs), all else like bg and width
can be accounted for, but the rect can only be rid of by leaving
out the specs (I don't like doing this, but I suppose it is a
thought for the occasional pictured heading)...

What rectangle, the focus rectangle?

This seems to render pretty good in IE, but in Mozilla it sucks.
(I
include the last in the list with same bg as the page (my
preferred practice for most headings, even the rare pictured
ones), this looked the best to me off line, but not online.
Anyway it is too complicated for now, I would need to make
screen shots to show you what I see... For now it seems that a
span or h1 is best for online - on the evidence of my eyes. I
started out this post saying things like "Yes, the object
element is the go..." till I tried online. Maybe that server is
lousy? Will try others...

I will take a look on Windows browsers when I can...

Don't anyone worry about all this too much...it is not any kind
of urgent problem. No wonder pharmeceutical drugs cost so much,
testing anything seems to take up enormous quantities of time.

I'd like to know more about the object object, too, so am interested.
 
D

dorayme

From: Neredbojias said:
What rectangle, the focus rectangle?

When you have an <img src="whatever.jpg" width="300"
height="150" alt="Don't show a rectangle, not even with feint
the borders, for where the picture /would/ have gone">, some
browsers ignore it and want to show off how they worked to
prepare space for it...

Is this any help? Perhaps you have not seen this in your
browsers. Some do it and some do not.

dorayme
 
N

Neredbojias

With neither quill nor qualm, dorayme quothed:
When you have an <img src="whatever.jpg" width="300"
height="150" alt="Don't show a rectangle, not even with feint
the borders, for where the picture /would/ have gone">, some
browsers ignore it and want to show off how they worked to
prepare space for it...

Is this any help? Perhaps you have not seen this in your
browsers. Some do it and some do not.

dorayme

Okay, you've been hitting the sauce again, haven't you? Luigi was
right.
 
D

dorayme

From: Neredbojias said:
With neither quill nor qualm, dorayme quothed:


Okay, you've been hitting the sauce again, haven't you? Luigi was
right.

Let me say it again without anything that may mislead you. You
know how desperate I am to help you Boji.

When you have an <img src="whatever.jpg" width="300"
height="150" alt="picture of Italian seagull in Sweden">, some
browsers not only provide a 300px by 150px space for the picture
when loading the page but also /display/ this space with a
border even though the picture fails to load. Getting it?

Actually I am very sober (sort of pathetic 2 glasses of wine
with dinner and occasional beer, maybe a good slug of
bourbon/brandy/port if it is around too). I am extremely
disappointed in my drinking, it interferes with the fine
machinery of my considerable brain. Nevertheless, I have
possibly wild liberal views on drugs except where any of my
family are concerned... (psst... wanna see an article I wrote
about the drug laws?).

dorayme
 
N

Neredbojias

With neither quill nor qualm, dorayme quothed:
Let me say it again without anything that may mislead you. You
know how desperate I am to help you Boji.

When you have an <img src="whatever.jpg" width="300"
height="150" alt="picture of Italian seagull in Sweden">, some
browsers not only provide a 300px by 150px space for the picture
when loading the page but also /display/ this space with a
border even though the picture fails to load. Getting it?

Okay, but your previous mess. implied that alt text had something to do
Actually I am very sober (sort of pathetic 2 glasses of wine
with dinner and occasional beer, maybe a good slug of
bourbon/brandy/port if it is around too). I am extremely
disappointed in my drinking, it interferes with the fine
machinery of my considerable brain. Nevertheless, I have
possibly wild liberal views on drugs except where any of my
family are concerned... (psst... wanna see an article I wrote
about the drug laws?).

Yes. I dunno much about Australian narcotics problems, but the much-
talked-about internet accessibility statutes tend to abet my interest in
things legislative down under.
 
D

dorayme

From: Neredbojias said:
Okay, but your previous mess. implied that alt text had something to do
with this placeholder rectangle. So if you use <object> for images in
Mozilla, you don't get the rectangle..?


Yes, I realised how you could have failed to appreciate the joke
in my previous "mess". Perhaps I better be very serious for a
while, lie low, shoot straight arrows, bowl a good line, keep a
straight bat... no... it is too boring to contemplate...

dorayme
 
L

Luigi Donatello Asero

"dorayme" <[email protected]> skrev i meddelandet

[cut]
Perhaps I better be very serious for a
while,

Do you really think that it would be possible?

--
Luigi Donatello Asero
(sono italiano ma vivo in Svezia)
(Ñ Ð¸Ñ‚Ð°Ð»ÑŒÑнец но Ñ Ð¶Ð¸Ð²Ñƒ в Швеции )
(我是 æ„大利人 , 但是 我 ä½ åœ¨ ç‘žå…¸)
(minä olen Italian kansalainen, mutta minä asun Ruotsissa)
(yo soy italiano mas vivo en Suecia)
(je suis italien mais j' habite a la Suede)
(ich bin Italiener aber ich lebe in Schweden)
https://www.scaiecat-spa-gigi.com/
 
D

dorayme

From: Neredbojias said:
Nevertheless, I have

Yes. I dunno much about Australian narcotics problems, but the much-
talked-about internet accessibility statutes tend to abet my interest in
things legislative down under.

Yes, I realised how you could have failed to appreciate the joke
in my previous "mess". Perhaps I better be very serious for a
while, lie low, shoot straight arrows, bowl a good line, keep a
straight bat... no... it is too boring to contemplate...

You better ask Mark Parnell about this or look up links he
gave... Me, I do what I can, I lock all doors and post guards if
I use any tables, feel slack about alt tag contents etc etc. I
also ensure a Plan B exit strategy, charging the batteries in my
rocket for back to mars...

As for drugs there is nothing special here, successive
governments have followed the absolutely disastrous American
policy of Prohibition...

dorayme
 
N

Neredbojias

With neither quill nor qualm, dorayme quothed:
Yes, I realised how you could have failed to appreciate the joke
in my previous "mess". Perhaps I better be very serious for a
while, lie low, shoot straight arrows, bowl a good line, keep a
straight bat... no... it is too boring to contemplate...

Too-straight a bat is not a good thing. -At least for guys.
You better ask Mark Parnell about this or look up links he
gave... Me, I do what I can, I lock all doors and post guards if
I use any tables, feel slack about alt tag contents etc etc. I
also ensure a Plan B exit strategy, charging the batteries in my
rocket for back to mars...

As for drugs there is nothing special here, successive
governments have followed the absolutely disastrous American
policy of Prohibition...

Well, who wants a bunch of airheads roaming the cityside, etc.? And
where's the article? The dingoes must be having a good howl tonight.
 
D

dorayme

From: Neredbojias said:
where's the article?

I have put it at http://150m.com/opinionFolder/drugLaws.html for
you to read...

Just btw (this is a /joke/, Ms. de Zoete)

<h1>Reason and the Drug Laws</h1>
<h2>by dorayme</h2>

may be naughty? (and the resulting <h3>s and that there is a better
alternative to my quick fix...

and

<p style="margin-left:auto;margin-right:auto;width:10em">* * * *
* * * * *</p>

as a separator.

But the alternatives do not immediately come to mind sharply and
clearly and well formed. I have done various things over the
years for such things. Things like an <h1> Heading <br> in and then
a span styled to go down in size...

There is something nice about html that you can still "get by"
(and not with such small values of "get by", to use a clever
phrase by the good Mr Flavell) - like my old car...

dorayme
 
D

dorayme

From: Leonard Blaisdell said:

'File not found'. And I wanted to see if it was in frames ;-)

leo
[/QUOTE]

This server is driving me crazy, I always forget something from
the address, you have to stick a dorayme in front of the 150. So
sorry... I am so sick of being anonymous, you can't believe the
pain and confusion I am in... I have begged my controllers back
on my planet to let me reveal rank and formal name. They say it
is still too dangerous (they asked me where Korpela was, I said
I did not know and then they just refused me permission...).

http://dorayme.150m.com/opinionFolder/drugLaws.html

Yes, ok Leo, you tell me what is wrong with the frames you find
there...

dorayme
 
D

dorayme

From: Leonard Blaisdell said:
Organization: Studio H
Newsgroups: alt.html
Date: Fri, 14 Oct 2005 21:06:55 -0700
Subject: Re: styled text substitute for a picture that fails to load...



Well done page. Now let me check it in Lynx. Mutter, mumble, mumble.
I'd break some of the logical headings into links so as not to make the
page so long, but you weren't asking for criticism. And I'm not
criticizing.

Er well, Leo..., I don't mind, you know how easy going I am...
my ears (I mean, my antennae) are always pricked for suggestions
I can remember that make good solid sense. I'd not be keen to
webisize it as an exercise. Actually, you now make me think.
What am I keen on? I suppose for it to be printed. Thinks. Ah, a
stylesheet for this purpose, I must have a go at this for the
experience and in this case, it could be quite practical. I've
got Acrobat (to make things, not just to read) on a sad Windows
machine in an upstairs office, hmm... another thought...

I send it as an attachment or a link to various fuddy duddies,
especially puritan types in the media, politicians and even
academics who can't think past their noses... almost everyone
has this prohibition thing deep in their bones, they simply
cannot imagine the long term effects of a more sensible policy.

After I posted it to 150m.com I suddenly had an inspiration born
of fear. I thought, O Christ! Mark Parnell or someone will
notice I have a fixed 450px wide div for the main text but what
if someone enlarges big... looks awful...

The idea was to keep lines reasonable unwide. 450 px is
reasonably comfortable to read for average sizes but I changed
it to em and guessed a figure, what was it? 35em? This had the
advantage of not being uncomfortable when big. Of course, big
big brings in the h-scrollbar unlike fixed px but in this case
it is not unreasonable. I expect it is a matter of judgement how
many ems to give for this sort of thing... If anyone wants to
say what they do in such situations, they are welcome and I
listen with interest.

dorayme
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top