Thanks for all of your replies. I should have provided more detail.
I apologize in advance for the length of this posting.
This app is for an internal intranet, so I can't show it to you. The
app's purpose is to allow our collections centers to communicate with
our branches, to request informatin. The text on the page is abridged
so that more lines of dialogue between our collection centers and our
branches can be seen. Each abridged dialog line ends with "(more...)"
which is linked to the full text. In addition, each entire request's
dialogue is accessible, with the entire text of each dialogue line
shown.
Here is the stylesheet, cssMediaTest.css, for my test page:
*******BEGIN STYLESHEET*********
@media print {
.longText {
display : block;
}
.moreText {
display : none;
}
}
@media screen {
.longText {
display : none;
}
.moreText {
display : block;
}
}
*******END STYLESHEET*********
Here is the code of the test page, with some ColdFusion tags:
*******BEGIN CODE PAGE *********
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test Page</title>
<LINK REL="StyleSheet" type="text/css" HREF="cssMediaTest.css">
</head>
<body>
<cfset text = "This is a long piece of text. This is a long piece of
text. This is a long piece of text. This is a long piece of text.
This is a long piece of text. This is a long piece of text. This is
a long piece of text. This is a long piece of text. This is a long
piece of text. This is a long piece of text. This is a long piece of
text. ">
<cfset beginText = Left(text,50)>
<cfset endText = Mid(text,51,999)>
<cfoutput>
This is the text shown on the page:
#beginText#<cfif compareNoCase(endText,"")><span
class="moreText">...(more)</span><span
class="longText">#endText#</span></cfif>
</cfoutput>
</body>
</html>
*******END CODE PAGE*********
When I run this page and View Source in the browser, I get:
*******BEGIN VIEW SOURCE*********
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test Page</title>
<LINK REL="StyleSheet" type="text/css" HREF="cssMediaTest.css">
</head>
<body>
This is the text shown on the page:
This is a long piece of text. This is a long piec<span
class="moreText">...(more)</span><span class="longText">e of text.
This is a long piece of text. This is a long piece of text. This is
a long piece of text. This is a long piece of text. This is a long
piece of text. This is a long piece of text. This is a long piece of
text. This is a long piece of text. This is a long piece of text.
</span>
</body>
</html>
*******BEGIN VIEW SOURCE*********
The above View Source looks correct to me. However, when the test
page is run in IE 6, or when I print it I get line break after 'This
is a long piec', right where the first span begins. This is what I
need to fix.
Sorry to be so lengthy; I have probably erred on the side of verbosity
this time. Any ideas, references, resources, or good clean jokes
would be greatly appreciated.
Kathryn
And what happens in speech browsers, or when CSS is off?
This is a long piece of text. This is a long piece of text. This
is<span class="moreText">...(more)</span><span class="longText"> a
long piece of text. This is a long piece of text.</span>
We need the URL. The URL will give access to the exact markup _and_ to
the style sheet, and lots of other information.
What is incorrect is that the text is
showing on the printed report with a line break at the location of the
<span>:
This is probably caused by something in the style sheet.
As I understood <span> tags, they are inline tags, as opposed to <div>
tags, which are block tags. Inline tags specifically are not supposed
to cause line breaks, right?
Correct. But this can be changed by changing the value of the display
property in CSS, explicitly or implicitly.
Any ideas, suggestions, war stories, or good clean jokes would be
greatly appreciated.
I'm not sure why you want to be the onscreen version abridged, but in
general I would create two versions of the document itself and perhaps
label them as "screen" and "print" versions and link them to each other.
I think it would be rather restrictive if the user cannot access the full
version except by printing the document (or doing a print preview).