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

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

am 23.09.2007 12:59:20 von 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?

Re: in css, after pseudoclass doesn"t work with br tag?

am 23.09.2007 13:28:16 von jkorpela

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
markup, not line breaks in
general.

Then you can indeed make
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.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Re: in css, after pseudoclass doesn"t work with br tag?

am 24.09.2007 00:39:45 von AlexG

Hi again.

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

I must have confused
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.

Re: in css, after pseudoclass doesn"t work with br tag?

am 24.09.2007 08:53:05 von jkorpela

Scripsit AlexG:

> Hi again.

Please learn how to quote in Usenet. Proper quotion includes attributions.

> I must have confused
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).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/