As an exercise, I've set up the following snippet:
<html>
<head>
<STYLE TYPE="text/css">
.italic {
display: inline;
font-style: italic;
}
</style>
</head>
<p>Regular Text</p>
<body>
<p><span class="italic">Display As Italics</span></p>
</body>
</html>
and it works as expected when I display it in the browser.
What I can't seem to find is any property or any way to set it up so
that, when the browser displays the italics, they're displayed
surrounded by underscore characters thus: "_Display As Italics_".
Is there any way to pull this off in CSS? Thank you.
Evertjan. - 27 Jun 2007 18:31 GMT
Geoffrey Kidd wrote on 27 jun 2007 in
comp.infosystems.www.authoring.stylesheets:
> As an exercise, I've set up the following snippet:
>
[quoted text clipped - 3 lines]
> .italic {
> display: inline;
What do you think to accomplish with the inline?
slan is inline by default.
> font-style: italic;
> }
> </style>
> </head>
> <p>Regular Text</p>
That is outside the body!
> <body>
> <p><span class="italic">Display As Italics</span></p>
[quoted text clipped - 8 lines]
>
> Is there any way to pull this off in CSS? Thank you.
What do you think?
Is an underscore character a style?

Signature
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Geoffrey Kidd - 27 Jun 2007 19:10 GMT
Your criticism of having the first paragraph before the <body> tag is
well taken.
The "inline" is taken from an HTML/CSS pair of files that came in an
eBook I bought from the publisher. My main interest was/is in how to
modify italics display by the browser, so I can simply have the
browser display the file and I can then select the text, copy it, and
paste it as a text file that I can load into my Palm as text plus
_italics_.
>Geoffrey Kidd wrote on 27 jun 2007 in
>comp.infosystems.www.authoring.stylesheets:
[quoted text clipped - 34 lines]
>
>Is an underscore character a style?
Evertjan. - 27 Jun 2007 20:52 GMT
Geoffrey Kidd wrote on 27 jun 2007 in
comp.infosystems.www.authoring.stylesheets:
[Please do not toppost on usenet]
>>Geoffrey Kidd wrote on 27 jun 2007 in
>>comp.infosystems.www.authoring.stylesheets:
[quoted text clipped - 9 lines]
>>What do you think to accomplish with the inline?
>>slan is inline by default.
span ;-(
> Your criticism of having the first paragraph before the <body> tag is
> well taken.
> The "inline" is taken from an HTML/CSS pair of files that came in an
> eBook I bought from the publisher.
If you want to experiment, it pays not to have code, you don't need,
methinks.
[..]
>>> What I can't seem to find is any property or any way to set it up so
>>> that, when the browser displays the italics, they're displayed
[quoted text clipped - 5 lines]
>>
>>Is an underscore character a style?
> My main interest was/is in how to
> modify italics display by the browser, so I can simply have the
> browser display the file and I can then select the text, copy it, and
> paste it as a text file that I can load into my Palm as text plus
> _italics_.
Ok

Signature
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Beauregard T. Shagnasty - 27 Jun 2007 18:50 GMT
> As an exercise,
Good to hear it is only an exercise. I don't see any real-world use.
> I've set up the following snippet:
>
[quoted text clipped - 3 lines]
> font-style: italic;
> }
.italic:before {content: "_"; }
.italic:after {content: "_"; }
> </style>
> What I can't seem to find is any property or any way to set it up so
> that, when the browser displays the italics, they're displayed
> surrounded by underscore characters thus: "_Display As Italics_".
>
> Is there any way to pull this off in CSS? Thank you.
Most modern browsers should show the underscores.

Signature
-bts
-Motorcycles defy gravity; cars just suck
Geoffrey Kidd - 27 Jun 2007 19:15 GMT
Thank you. It worked perfectly.
For the real-world use: I buy eBooks, and frequently end up with
HTML/CSS pairs that I want to convert to text plus _italics_ to stash
in my Palm and read. The quick way to do that is to display the HTML
in the browser, selectALL on the text and copy/past it into a plain
TXT file for loading. I've been using a script in my text editor, but
think making a small mod to the CSS file is a more elegant approach,
not to mention a great timesaver.
>> As an exercise,
>
[quoted text clipped - 20 lines]
>
>Most modern browsers should show the underscores.
Christopher Night - 27 Jun 2007 18:53 GMT
> As an exercise, I've set up the following snippet:
>
[quoted text clipped - 20 lines]
>
> Is there any way to pull this off in CSS? Thank you.
Yes. Use the content attribute on the before and after pseudo-elements:
.italic:before, .italic:after {
content: "_";
}
See here for more details:
http://www.w3.org/TR/REC-CSS2/generate.html
-Christopher
Geoffrey Kidd - 27 Jun 2007 19:26 GMT
Works beautifully on the display. (Thank you.) But the browser, when I
hit "Select All" to copy off the results, does *NOT* select the
underscores, which was kind of the point of the exercise, which is
converting the HTML using quickie copy/paste, to create text plus
_italics_.
Any suggestions? Thanks.
>> As an exercise, I've set up the following snippet:
>>
[quoted text clipped - 31 lines]
>
>-Christopher
Geoffrey Kidd - 27 Jun 2007 19:28 GMT
[grin] Never mind. "Print to generic text printer" to file worked
perfeclty.
Thank you for all the help.
>Works beautifully on the display. (Thank you.) But the browser, when I
>hit "Select All" to copy off the results, does *NOT* select the
[quoted text clipped - 39 lines]
>>
>>-Christopher
Andy Dingley - 28 Jun 2007 00:24 GMT
>But the browser, when I
>hit "Select All" to copy off the results, does *NOT* select the
>underscores, which was kind of the point of the exercise,
I should hope not! This sort of CSS content production is intended for
"eye candy", not content.
I'm glad you sorted it. Otherwise I'd have gone at it with XSLT
Ben C - 27 Jun 2007 18:53 GMT
> As an exercise, I've set up the following snippet:
>
[quoted text clipped - 20 lines]
>
> Is there any way to pull this off in CSS? Thank you.
span.italic:before { content: "_"; }
span.italic:after { content: "_"; }
Standard (CSS 2.1) but might not work in all browsers.
Geoffrey Kidd - 27 Jun 2007 19:15 GMT
Thank you. Much appreciated
>> As an exercise, I've set up the following snippet:
>>
[quoted text clipped - 25 lines]
>
>Standard (CSS 2.1) but might not work in all browsers.