473,799 Members | 3,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Img alt content shown on printouts instead of image

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
Jul 20 '05 #1
2 4126
Johannes Koch <ko**@w3develop ment.de> wrote:
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/
Jul 20 '05 #2
Johannes Koch wrote:
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:hidd en;
width:0;
height:0;
}
img:after {
display:block;
visibility:visi ble;
content:attr(al t);
}

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
Jul 20 '05 #3

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

Similar topics

14
5615
by: laurence | last post by:
I am implementing a comprehensive image-map generator utility, so have been studying W3C HTML 4.01 Specification (http://www.w3.org/TR/html4/struct/objects.html#h-13.6) on image maps (among other things). I note the document specifies that block level content can be included within a <map>. Testing this in order to discover why one might wish to do this, I find the block level content is rendered in page flow order anyway, and not...
5
15404
by: mike | last post by:
Is there any way I can change the content type when I open a new window other than opening a script in the open statement? mywin = window.open('','rpt','width=600,height=425,top=50,left=0,scrollbars=yes,toolbar=yes,resizable=yes,dependent=no'); mywin.document.write("Content-type:image/svg+xml"); In this example I would be changing the content type to svg.
1
2273
by: Lenard Gunda | last post by:
Hi! I have the following problem. From my main page, when someone clicks a button, it uses client side javascript to open another .aspx page. This page displays content, based on what the first page is set to show. If you change the first page, and click the button again, the newly opened page will show other things. Nothing special. It also works fine, except ...
1
3579
by: Grzegorz Kaczor | last post by:
Hello, I wanted to use Response.TransmitFile to return an image instead of a HTML page. Under IE everything works well, but under Mozilla/Firefox the image is treated as it were text/html. When I set up content-type in response to image/jpeg everything works well. But I would like to send any file instead of an image and thus I cannot always know the proper content type. Is it possible to "autodetect" a
7
1506
by: Andrew Robinson | last post by:
Given HTML text (likely from SQL), is there any method that could be employed to render server and/or custom controls that are contained inside of that text? I would be loading content from a database and would like to 'expand' the server controls. Possibly even recursively. Hope this makes sense, but I am guessing the answer is no. If this is something that can't be done, I am looking at creating my own markup tags and searching for...
1
1661
by: athirumurthi | last post by:
I have a WinINet communicating with an integration server (X-AspNet-Version: 1.1.4322) using form posts. One form post that includes jpeg content. However, the data received at the server is missing bytes from the beginning of the jpeg. It could be that the whole exif header that has been stripped. I can upload the same jpeg successfully using a .htm with Internet Explorer. Using a port sniffer and diff tools, I can verify that the...
4
2506
by: B Squared | last post by:
I'm trying to pass a filename (which is a jpeg image) to a php function / file so that it will display. I know that its simple to get PHP to display an image hardcoding in the filename. For example, an href to this: <?php header("content-type:image/jpeg"); $filename = "image_file.jpg"; $im=ImageCreateFromJPEG($filename); ImageJPEG($im);
8
5913
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web clients (Internet Explorer). My flash content was originally brought in via the “flash satay” method, but I have since used some server-side magic do deliver one <objecttag
9
2986
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I got the core of the javascript from here: http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm I noticed in the demo that sometimes the content takes a long
0
9540
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10475
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.