How to indent a line after <br />

Discussion in 'HTML' started by tintagel, Mar 14, 2006.

  1. tintagel

    tintagel Guest

    Hi everyone, I've just joined your group!

    I'm pretty new to HTML etc. Here's my problem:

    I'm attached to the idea of keeping content separate from formatting
    information, so I like putting content in a .xml document and then
    making a stylesheet for it.

    At the moment I'm working on a lot of prose-style text, and having to
    enclose everything in double-sided <xyz></xyz> tags in order to get any
    kind of indentation between blocks is not so convenient. This is
    especially true when formatting dialogue in fiction, where you need
    line breaks and indentation for lots of very short, consecutive lines
    of text.

    The approach I'm currently pursuing is to put an emtpy node called <br
    /> in the .xml source where I need a line break, and then use .xsl and
    ..css stylesheets to instuct the browser to interpret this as "do a line
    break, but indent the first character of the next line".

    The only way to do this that I've currently found is a rather inelegant
    'cheat' using the zero width non-joiner &zwnj; (‌), thus
    (extracting from the stylesheet):

    <xsl:template match="br">
    <br />
    <span id="indent">&zwnj;</span>
    </xsl:template>

    where "indent" pads on the left by 1em.

    (De-confuser: the matched "br" is the empty node that lives in the .xml
    source.)

    This works o.k., and doesn't upset the "text-align: justify" which is
    in effect throughout the document (and which for example, if I
    substitute the <span></span> expression with &emsp, leaves the indented
    text misaligned as the space character is factored into the
    justification). I guess it's an o.k. work-around, but it's still a
    misuse of an entity (&zwnj;), which can't be good practice and leaves a
    bitter taste in the mouth.

    Is there a way of achieving the same result in a more concrete manner
    using CSS? Or is there a safer 'placeholder entity' I can use instead
    of &zwnj; to put inside the <span> so it actually indents the following
    character? A crucial consideration here seems to be the justified text,
    and how to avoid mucking it up.

    I'd really appreciate any advice on this!

    Best wishes,

    T.
     
    tintagel, Mar 14, 2006
    #1
    1. Advertising

  2. tintagel

    Alan Cole Guest

    In article <>,
    "tintagel" <> wrote:

    > Hi everyone, I've just joined your group!
    >
    > I'm pretty new to HTML etc. Here's my problem:
    >
    > I'm attached to the idea of keeping content separate from formatting
    > information, so I like putting content in a .xml document and then
    > making a stylesheet for it.
    >
    > At the moment I'm working on a lot of prose-style text, and having to
    > enclose everything in double-sided <xyz></xyz> tags in order to get any
    > kind of indentation between blocks is not so convenient. This is
    > especially true when formatting dialogue in fiction, where you need
    > line breaks and indentation for lots of very short, consecutive lines
    > of text.
    >
    > The approach I'm currently pursuing is to put an emtpy node called <br
    > /> in the .xml source where I need a line break, and then use .xsl and
    > .css stylesheets to instuct the browser to interpret this as "do a line
    > break, but indent the first character of the next line".
    >
    > The only way to do this that I've currently found is a rather inelegant
    > 'cheat' using the zero width non-joiner &zwnj; (‌), thus
    > (extracting from the stylesheet):
    >
    > <xsl:template match="br">
    > <br />
    > <span id="indent">&zwnj;</span>
    > </xsl:template>
    >
    > where "indent" pads on the left by 1em.
    >
    > (De-confuser: the matched "br" is the empty node that lives in the .xml
    > source.)
    >
    > This works o.k., and doesn't upset the "text-align: justify" which is
    > in effect throughout the document (and which for example, if I
    > substitute the <span></span> expression with &emsp, leaves the indented
    > text misaligned as the space character is factored into the
    > justification). I guess it's an o.k. work-around, but it's still a
    > misuse of an entity (&zwnj;), which can't be good practice and leaves a
    > bitter taste in the mouth.
    >
    > Is there a way of achieving the same result in a more concrete manner
    > using CSS? Or is there a safer 'placeholder entity' I can use instead
    > of &zwnj; to put inside the <span> so it actually indents the following
    > character? A crucial consideration here seems to be the justified text,
    > and how to avoid mucking it up.
    >
    > I'd really appreciate any advice on this!
    >
    > Best wishes,
    >
    > T.


    I'm probably missing something here, but wouldn't it be simpler to
    replace the <br />tag with </p><p> and then simply indent the first line
    of the paragraph??

    Al.

    --
    Alan Cole. E-mail: justal at lineone dot net
    http://www.forces-of-nature.co.uk [Coastal Sports]
    http://www.pixelwave.co.uk [Website Design, hosting and promotion]
     
    Alan Cole, Mar 14, 2006
    #2
    1. Advertising

  3. tintagel

    Andy Dingley Guest

    tintagel wrote:
    > Hi everyone, I've just joined your group!


    Then don't multi-post into it. Cross-post if you have to
     
    Andy Dingley, Mar 14, 2006
    #3
  4. While the city slept, tintagel () feverishly typed...

    [...]

    > At the moment I'm working on a lot of prose-style text, and having to


    [...]

    > The approach I'm currently pursuing is to put an emtpy node called <br
    > /> in the .xml source where I need a line break, and then use .xsl and


    You have to think about what you are creating. Prose is a collection of
    paragraphs, not text separated by line breaks. Therefore, use the <p>
    element, and style it so that the first line is indented.

    Cheers,
    Nige

    --
    Nigel Moss http://www.nigenet.org.uk
    Mail address will bounce. | Take the DOG. out!
    "Your mother ate my dog!", "Not all of him!"
     
    nice.guy.nige, Mar 15, 2006
    #4
  5. tintagel

    tintagel Guest

    Hello Andy,

    I don't quite follow you. As far as I'm aware (and intended), I made
    one post to this group on this topic. I made the same post to other
    groups which looked promising, in order to cast the net as wide as
    possible.

    >Then don't multi-post into it. Cross-post if you have to


    Feeling welcome already. Is that the way you talk to people
    face-to-face?
     
    tintagel, Mar 19, 2006
    #5
  6. tintagel

    tintagel Guest

    Thanks for your reply. <p>'s requiring a closing tag is an
    inconvenience. I'm looking for a way of achieving the same result with
    a single, empty tag in xml.

    Cheers,

    T
     
    tintagel, Mar 19, 2006
    #6
  7. tintagel

    tintagel Guest

    Hello again Andy,

    I've just spotted that you made a helpful reply to the same question I
    posted to another group, for which I owe you thanks. I presume
    therefore that what you meant by, 'Then don't multi-post into it.
    Cross-post if you have to,' is that I shouldn't have posted the same
    message to different groups. Fair point if 'multi-posting' causes
    problems, but I don't know how to do 'cross-post'.

    T
     
    tintagel, Mar 19, 2006
    #7
  8. tintagel wrote:

    > Hello again Andy,
    >
    > I've just spotted that you made a helpful reply to the same question I
    > posted to another group, for which I owe you thanks. I presume
    > therefore that what you meant by, 'Then don't multi-post into it.
    > Cross-post if you have to,' is that I shouldn't have posted the same
    > message to different groups. Fair point if 'multi-posting' causes
    > problems, but I don't know how to do 'cross-post'.
    >
    > T
    >

    XPosting is posting one message ONCE with more than one group listed in
    the T0 field as opposed to posting the message in one group then again
    in another....

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 19, 2006
    #8
  9. Jonathan N. Little wrote:

    > tintagel wrote:
    >
    >> I've just spotted that you made a helpful reply to the same question
    >> I posted to another group, for which I owe you thanks. I presume
    >> therefore that what you meant by, 'Then don't multi-post into it.
    >> Cross-post if you have to,' is that I shouldn't have posted the same
    >> message to different groups. Fair point if 'multi-posting' causes
    >> problems, but I don't know how to do 'cross-post'.


    You probably can't cross-post, using the Google Groups web interface to
    Usenet. (You do know this is Usenet, and not a web site, correct?) Does
    your ISP offer you NNTP News service? If so, sign up and get a real news
    reader to access it.

    > XPosting is posting one message ONCE with more than one group listed
    > in the T0 field as opposed to posting the message in one group then
    > again in another....


    And the why not to multi-post:

    http://oakroadsystems.com/genl/unice.htm#xpost

    --
    -bts
    -Warning: I brake for lawn deer
     
    Beauregard T. Shagnasty, Mar 19, 2006
    #9
  10. Beauregard T. Shagnasty wrote:

    [...]
    > You probably can't cross-post, using the Google Groups web interface to
    > Usenet. ...



    Yes, you can. It's not that difficult, even with google groups.

    Nick

    --
    Nick Theodorakis

    contact form:
    http://theodorakis.net/contact.html
     
    Nick Theodorakis, Mar 19, 2006
    #10
  11. Beauregard T. Shagnasty wrote:

    > Jonathan N. Little wrote:
    >
    >
    >>tintagel wrote:
    >>
    >>
    >>>I've just spotted that you made a helpful reply to the same question
    >>>I posted to another group, for which I owe you thanks. I presume
    >>>therefore that what you meant by, 'Then don't multi-post into it.
    >>>Cross-post if you have to,' is that I shouldn't have posted the same
    >>>message to different groups. Fair point if 'multi-posting' causes
    >>>problems, but I don't know how to do 'cross-post'.

    >
    >
    > You probably can't cross-post, using the Google Groups web interface to
    > Usenet. (You do know this is Usenet, and not a web site, correct?) Does
    > your ISP offer you NNTP News service? If so, sign up and get a real news
    > reader to access it.


    I've personally only use GG to view messages on occasion, but all
    posting I have done was via NNTP except for DejaNews long ago. The GG UI
    must really suck.


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 19, 2006
    #11
  12. Nick Theodorakis wrote:

    > Beauregard T. Shagnasty wrote:
    >
    > [...]
    >> You probably can't cross-post, using the Google Groups web interface to
    >> Usenet. ...

    >
    > Yes, you can. It's not that difficult, even with google groups.


    Is there a page citing how to do that, which everyone could use to tell
    the GGers how? (I don't use GG.) Something like safalra's quoting page.

    --
    -bts
    -Warning: I brake for lawn deer
     
    Beauregard T. Shagnasty, Mar 19, 2006
    #12
  13. Jonathan N. Little wrote:

    > Beauregard T. Shagnasty wrote:
    >
    >> Jonathan N. Little wrote:
    >>
    >>
    >>>tintagel wrote:
    >>>
    >>>
    >>>>I've just spotted that you made a helpful reply to the same question I
    >>>>posted to another group, for which I owe you thanks. I presume
    >>>>therefore that what you meant by, 'Then don't multi-post into it.
    >>>>Cross-post if you have to,' is that I shouldn't have posted the same
    >>>>message to different groups. Fair point if 'multi-posting' causes
    >>>>problems, but I don't know how to do 'cross-post'.

    >>
    >>
    >> You probably can't cross-post, using the Google Groups web interface to
    >> Usenet. (You do know this is Usenet, and not a web site, correct?) Does
    >> your ISP offer you NNTP News service? If so, sign up and get a real news
    >> reader to access it.

    >
    > I've personally only use GG to view messages on occasion, but all posting
    > I have done was via NNTP except for DejaNews long ago. The GG UI must
    > really suck.


    http://blinkynet.net/comp/gggui.html

    --
    Blinky
    Killing all posts from Google Groups
    The Usenet Improvement Project: http://blinkynet.net/comp/uip5.html
    Coming Soon: Filter rules specific to various real news clients
     
    Blinky the Shark, Mar 19, 2006
    #13
  14. Blinky the Shark wrote:

    > Jonathan N. Little wrote:

    <snip>
    >>I've personally only use GG to view messages on occasion, but all posting
    >>I have done was via NNTP except for DejaNews long ago. The GG UI must
    >>really suck.

    >
    >
    > http://blinkynet.net/comp/gggui.html
    >

    I guess we are doom to suffer!

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 19, 2006
    #14
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hugo
    Replies:
    10
    Views:
    1,403
    Matt Humphrey
    Oct 18, 2004
  2. dt
    Replies:
    4
    Views:
    534
    CBFalconer
    Dec 31, 2006
  3. kaushikshome
    Replies:
    4
    Views:
    827
    kaushikshome
    Sep 10, 2006
  4. scad
    Replies:
    23
    Views:
    1,222
    Alf P. Steinbach
    May 17, 2009
  5. Marek Stepanek
    Replies:
    12
    Views:
    446
    Peter J. Holzer
    Sep 2, 2006
Loading...

Share This Page