By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,648 Members | 1,190 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,648 IT Pros & Developers. It's quick & easy.

Is this possible?

P: n/a
Hi,

I am in a process of creating a text version of my website and was
wondering if it was possible to accomplish this without actually
making the same page twice using CSS.

I have a stylesheet for printing only, which has no graphics. Would
it be possible to use the same page to display when the users clicks
on the text version link?

Or let's say I create text version of the home page and once the user
is on it and clicks on a link from that page, it will actually go to
the same page with graphics but with different style sheet, which will
hide all the images.

I hope I am explaining this correctly.

Thanks a lot
Maggie
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
AD.
On Tue, 28 Oct 2003 15:25:08 -0800, Maggie wrote:
Hi,

I am in a process of creating a text version of my website and was
wondering if it was possible to accomplish this without actually making
the same page twice using CSS.

I have a stylesheet for printing only, which has no graphics. Would it
be possible to use the same page to display when the users clicks on the
text version link?

Or let's say I create text version of the home page and once the user is
on it and clicks on a link from that page, it will actually go to the
same page with graphics but with different style sheet, which will hide
all the images.


You would probably need some scripting to do this. I personally would use
server side scripting (eg PHP) to either link a different stylesheet or
not include one at all.

The text only link could be something like:
<a href="mypage.php?style=text">Text Only</a>
And the php code in the page could decide what stylesheet to include based
on the value of the 'style' variable.

This would require another page load, but I assume you are trying to
reduce page maintenance effort rather than reduce server load.

If you need more help, a newsgroup for your favourite scripting platform
would be the best bet.

It may be possible with Javascript on the client without another page
load, but I think doing it on the server is more robust.

Cheers
Anton
Jul 20 '05 #2

P: n/a
ma****@etal.uri.edu (Maggie) wrote:
I am in a process of creating a text version of my website and was
wondering if it was possible to accomplish this without actually
making the same page twice using CSS.
Please use a more descriptive Subject line in future.

Also please note that text versions are _not_ recommended in accessibility
guidelines and rules. On the contrary, they say that text versions should
_not_ be created, except if you have _failed_, after all attempts, to comply
with the guidelines and rules in the recommended way. See e.g.
http://www.w3.org/TR/WCAG10/#tech-alt-pages
I have a stylesheet for printing only, which has no graphics.
This might or might not be a good idea. It depends on whether the graphics
are useful in printed copies or not. Large decorations often aren't.
Would
it be possible to use the same page to display when the users clicks
on the text version link?


Why would you do that? People who access your primary page using a text-only
browser, or a speech browser, or a graphic browser with image display
disabled, will get the alt attribute values in place of the images.
It's those values that you should worry about, not a text version.
And it's CSS related only to the the extent that
a) some use of images should be replaced by the use of styled text and
b) you should consider the possibility of styling <img> elements for the
purpose of making the alternate text appear the best possible way
on advanced graphic browsers with images disabled (so that e.g.
the textual alternative for a logo image, if nonempty, appears in
a manner that simulates the appearance of the logo).

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #3

P: n/a
On 28 Oct 2003 15:25:08 -0800, in
comp.infosystems.www.authoring.stylesheets ma****@etal.uri.edu
(Maggie) wrote:
| Hi,
|
| I am in a process of creating a text version of my website and was
| wondering if it was possible to accomplish this without actually
| making the same page twice using CSS.
|
| I have a stylesheet for printing only, which has no graphics. Would
| it be possible to use the same page to display when the users clicks
| on the text version link?
|
| Or let's say I create text version of the home page and once the user
| is on it and clicks on a link from that page, it will actually go to
| the same page with graphics but with different style sheet, which will
| hide all the images.
|
| I hope I am explaining this correctly.


I'm not sure if this will help you.

In your stylesheets you can define elements for screen or printing
using the following method.
----------------------------------
<HTML>
<HEAD>
<TITLE>Test</TITLE>
<style>
@media screen {
..noPrint { display:;
background: red;
font-size: 20px;
color: white;
border: 2px solid black;
margin: 10px 10px;
padding: 10px 10px;
}
img { display:;}
..graphic { display:; border: 5px solid red; }
}
@media print {
..noPrint { display: none; }
img { display : none; }
..graphic ( display: none; }
}
</style>
</HEAD>
<BODY>
<div class="noPrint">
<p>To print this page you need to set your printer configuration.
<BR>
Select the File menu option and then Page Setup.<BR>
Set the page Orientation to Landscape.<BR>
You may or many not need to adjust the page margins.<BR>
You can also remove/adjust the page header and footer
information.</p>
<p>This message will <STRONG><u>not</u></STRONG> be printed.</p>
</div>
<P>This line will be printed.
<img src="test1.jpg" />
<img src="test2.jpg" class="graphic" />
But nothing else will.</P>
</BODY>
</HTML>

---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Jul 20 '05 #4

P: n/a
Jeff North <jn****@yourpantsbigpond.net.au> wrote in message news:<r4********************************@4ax.com>. ..
On 28 Oct 2003 15:25:08 -0800, in
comp.infosystems.www.authoring.stylesheets ma****@etal.uri.edu
(Maggie) wrote:
| Hi,
|
| I am in a process of creating a text version of my website and was
| wondering if it was possible to accomplish this without actually
| making the same page twice using CSS.
|
| I have a stylesheet for printing only, which has no graphics. Would
| it be possible to use the same page to display when the users clicks
| on the text version link?
|
| Or let's say I create text version of the home page and once the user
| is on it and clicks on a link from that page, it will actually go to
| the same page with graphics but with different style sheet, which will
| hide all the images.
|
| I hope I am explaining this correctly.


I'm not sure if this will help you.

In your stylesheets you can define elements for screen or printing
using the following method.
----------------------------------
<HTML>
<HEAD>
<TITLE>Test</TITLE>
<style>
@media screen {
.noPrint { display:;
background: red;
font-size: 20px;
color: white;
border: 2px solid black;
margin: 10px 10px;
padding: 10px 10px;
}
img { display:;}
.graphic { display:; border: 5px solid red; }
}
@media print {
.noPrint { display: none; }
img { display : none; }
.graphic ( display: none; }
}
</style>
</HEAD>
<BODY>
<div class="noPrint">
<p>To print this page you need to set your printer configuration.
<BR>
Select the File menu option and then Page Setup.<BR>
Set the page Orientation to Landscape.<BR>
You may or many not need to adjust the page margins.<BR>
You can also remove/adjust the page header and footer
information.</p>
<p>This message will <STRONG><u>not</u></STRONG> be printed.</p>
</div>
<P>This line will be printed.
<img src="test1.jpg" />
<img src="test2.jpg" class="graphic" />
But nothing else will.</P>
</BODY>
</HTML>

---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------


Hi,

Thanks a lot for your input but I was hoping to have 2 different
stylesheets for the screen. I already have it set up for printing.
But thanks anyway

Maggie
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.