in css, after pseudoclass doesn't work with br tag?

A

AlexG

is there some way to make it work?

generally, i am trying to find a way to get my print stylesheet to
eliminate line breaks and replace them with the pipe character "|". I
figured that i would use br{display:none} and br:after{content:"|"}
to accomplish these goals, but the latter line of code fails to work.
what should i do?
 
J

Jukka K. Korpela

Scripsit AlexG:
is there some way to make it work?

"It"? It is bad style to imply the heading in text - in books, in journals,
on web pages, in e-mail, in Usenet postings, etc. You are supposed to write
the message body so that it can be understood without the heading (Subject
line).
generally, i am trying to find a way to get my print stylesheet to
eliminate line breaks and replace them with the pipe character "|".

That's a very vague idea, and sounds extremely odd. So if there's a
paragraph, hundreds of words long, you would want it to be printed as one
line, with just "|" where a line break would appear in some unspecified
situation.

I'm pretty sure you have misanalyzed your original problem. Care to share it
with us? If not, whatever you get is almostly surely not the right answer to
your real problem, though it might be a right answer to some other problem.
I figured that i would use br{display:none} and br:after{content:"|"}
to accomplish these goals, but the latter line of code fails to work.

Now you seem to consider only the effect of <br> markup, not line breaks in
general.

Then you can indeed make <br> ineffective (even on IE) using
br{display:none}. The other idea suffers from a few problems like
1) IE does not grok :after at all
2) by CSS specs, the content of br:after is part of the content of br (so it
has no impact when br has display:none)
3) if you remove br{display:none}, then br:after{content:"|"} _should_ have
the desired effect, overriding the default of br:after{content:"\0A";}, but
no browser gets this right, and they get it wrong in different ways.

Again, the real problem is something different, and its correct solution
probably involves some other markup.
 
A

AlexG

Hi again.
Now you seem to consider only the effect of <br> markup, not line breaks in
general.

I must have confused <br> line breaks with line breaks in general.
Bear with me; my knowledge in these areas isn't very sophisticated as
of yet. For my purposes, though, either one will do.

I'm trying to replace line breaks to create a stylesheet for extremely
condensed printing. Simply setting br{display:none} comes close to
achieving my goal, but I'm still looking for a way to let the reader
(of the printed sheet) know where a line break *would have been* on
the screen version of the document.
That's a very vague idea, and sounds extremely odd. So if there's a
paragraph, hundreds of words long, you would want it to be printed as one
line, with just "|" where a line break would appear in some unspecified
situation.

I haven't thought about this. When I tested printing the document with
br{display:none}, (some of) the line breaks did indeed disappear, but
the text still wrapped around the page. I agree that it would be
useless to eliminate line breaks if there was no text wrapping.

Is there any way for me to replace line breaks with "|" while
preserving text wrapping on the printed page? The document I'm working
on is a small wiki and I can safely assume that everyone printing from
it will be a mozilla user.

Thanks,

--Alex.
 
J

Jukka K. Korpela

Scripsit AlexG:
Hi again.

Please learn how to quote in Usenet. Proper quotion includes attributions.
I must have confused <br> line breaks with line breaks in general.
Yes.

I'm trying to replace line breaks to create a stylesheet for extremely
condensed printing.

Why didn't you include a URL that demonstrates what you are really doing?
The document I'm working
on is a small wiki and I can safely assume that everyone printing from
it will be a mozilla user.

Such assumptions are never safe, and differences between Mozilla versions
can be quite considerable (depending on what you are doing or trying to
accomplish).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top