HighDots Forums  

Img alt content shown on printouts instead of image

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Img alt content shown on printouts instead of image in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Headless
 
Posts: n/a

Default Img alt content shown on printouts instead of image - 08-26-2003 , 11:28 AM






I'm pretty sure this isn't possible, but to be sure: in an author print
style sheet is it possible to disable printing of a graphic logo and
print it's alt content instead?


Headless

--
Email and usenet filter list: http://www.headless.dna.ie/usenet.htm

Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Img alt content shown on printouts instead of image - 08-26-2003 , 12:10 PM






Johannes Koch <koch (AT) w3development (DOT) de> wrote:

Quote:
img {
visibility: hidden;
width: 0;
height: 0;
}
img:after {
content: attr(alt);
}

(untested)
On Opera, neither the image nor the alt text is shown. And this would
seem to be what the specifications imply. The :after pseudo-element is
part of the element's content, not separate, so if that content is
invisible and zero-size, the alt text is not shown either.

On the other hand, Opera has the built-in feature that you can switch off
images, and then the alt texts appear. Ditto in Mozilla. So browsers that
would support the approach already have a corresponding functionality.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #3  
Old   
Headless
 
Posts: n/a

Default Re: Img alt content shown on printouts instead of image - 08-26-2003 , 12:20 PM



Johannes Koch wrote:

Quote:
I'm pretty sure this isn't possible, but to be sure: in an author print
style sheet is it possible to disable printing of a graphic logo and
print it's alt content instead?

Something like:

img {
visibility: hidden;
width: 0;
height: 0;
}
img:after {
content: attr(alt);
}

(untested)
Clever, it works (Opera/Moz) after a slight modification:

img {
visibility:hidden;
width:0;
height:0;
}
img:after {
display:block;
visibility:visible;
content:attr(alt);
}

And after adding a few body>'s it does no harm to poor old IE (tm).

Thanks,


Headless

--
Email and usenet filter list: http://www.headless.dna.ie/usenet.htm


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.