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

Old XHTML to new XHTML/CSS: Paragraph line?

P: n/a
one
Cutting out the <br>s.. Anyone who has a semantic/browser problem with
this conversion? Thanks.

<style>
p.line {margin: 0em;}
</style>

<!-- From -->
<p>text text<br />text text</p>

<!-- To -->
<p class="line">text text</p><p class="line">text text</p>
http://jaspoid.com/blogtests/p-line

Jan 17 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a

on*@jaspoid.com wrote:
Cutting out the <br>s..
Why? If they're really embedded linebreaks, then leave them as
linebreaks and <br>. If you mean "show my very short text snippets
without margins, but still mark them up as paragraphs" then it's fine.

You _might_ start a religious war over in alt.usage.english as to
whether a "snippet" can be a true paragraph, but that's sufficiently
unclear and arguable that it would eb wrong to make dogmatic HTML
coding decisions against it.

p.line {margin: 0em;}
I'd use margin-top and margin-bottom here, so as to leave the side
margins unchanged.

You also don't need units on 0
XHTML is a total red herring here. For entirely other reasons it's best
avoided anyway.

Jan 17 '07 #2

P: n/a
<on*@jaspoid.comwrote:
<style>
p.line {margin: 0em;}
</style>

<!-- From -->
<p>text text<br />text text</p>

<!-- To -->
<p class="line">text text</p><p class="line">text text</p>
It looks similar to what I'm considering doing for marking up poetry,
except I'd use a DIV rather than a P. Semantically, a line of poetry (or
whatever) isn't really a "paragraph", but a DIV can be anything. Also, the
default presentation of the DIVs is closer to the desired presentation.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"FAILURE IS NOT AN OPTION. It comes bundled with the software."
Jan 17 '07 #3

P: n/a
Thanks, guys! You're both, sort of, onto something.

The reason I'm pondering on this is that I'm building conversion
software for weblogs. From poor, non-standards XHTML to cutting edge,
contemporary XHTML that will probably be converted further into XHTML
2.0 when that becomes a W3C Recommendation.

Two additional reasons I want to move from <brto
<element></element><element></elementare:

1. I wan't true markup so that one can manipulate the stylesheets and
make effect without touching the HTML. You can't style a <p><BR></p>
although it consists of two elements - that is, lines.

2. I don't wan't hacky </empty tags in the documents for cleansity.

3. Call me picky :)

Anyway, Darin, I think you're probably right. If I can't make the
distinction between (context-changing) paragraph and line I will
probably go with that too - until XHTML 2.0, with <lline element,
becomes a W3C Recommendation:

http://www.w3.org/TR/xhtml2/mod-text.html#sec_9.7

Jan 17 '07 #4

P: n/a

Daniel Gr wrote:
1. I wan't true markup so that one can manipulate the stylesheets and
make effect without touching the HTML. You can't style a <p><BR></p>
although it consists of two elements - that is, lines.
You can style it, you just can't style it with existing CSS selectors.

You could also try this, which is as CSS-able as you could wish.

<p>
<span id="line-1" >...</span>
<br />
<span id="line-2" >...</span>
</p>

I think this is probably the best for what you want, although it's
horribly mechanical in how it presents structured text as no more than
a crude list of lines.
<div>
<div id="line-1" >...</div>
<div id="line-2" >...</div>
</div>

Really the best option is to apply an additional annotation mechanism
_over_ the expressed document through something like XPointer or a
development of it. This avoids the problem of intermeshing nested
elements from two unrelated purposes.

2. I don't wan't hacky </empty tags in the documents for cleansity.
Empty tags aren't hacky, mixed content models are hacky.

Jan 17 '07 #5

P: n/a
Thank you. I've gotten what I wanted to hear now. Just have to make up
my own mind now.

Jan 19 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.