How to prevent line break ?

Discussion in 'HTML' started by thogra, May 18, 2007.

  1. thogra

    thogra Guest

    Hi all,

    I have something like this: "This is a quote"

    Now I want the quotation marks to be a little larger:

    <span class="quote>&bdquo;</span>This is a quote<span
    class="quote>&rdquo;</span>

    My problem is now that the last quotation mark sometimes gets a
    linebreak making it standing alone on the next line which - of course
    - looks ugly.

    Can I somehow glue it to the last word in the sentence ?

    Thanks
    thogra, May 18, 2007
    #1
    1. Advertising

  2. thogra wrote:

    > Can I somehow glue it to the last word in the sentence ?


    Adding a "zero-width non-breaking space" character between the word
    and the quote mark should do the trick, but it's not supported in Internet
    Explorer.

    You could add <nobr>...</nobr> around the last word and quote mark, but
    this will stop your HTML for validating, as <nobr>, despite being widely
    supported, was never standardised. If validating your document is
    important to you, you could always create a custom DOCTYPE.

    The final option is to use something like <span class="nobr">...</span>
    instead of <nobr>...</nobr> and define a style like:

    .nobr { white-space: nowrap; }

    --
    Toby A Inkster BSc (Hons) ARCS
    http://tobyinkster.co.uk/
    Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
    Toby A Inkster, May 18, 2007
    #2
    1. Advertising

  3. Scripsit thogra:

    > I have something like this: "This is a quote"


    But what's the _exact_ thing you have? URL?

    > Now I want the quotation marks to be a little larger:


    Why? In any decent font, quotation marks have been designed to match the
    design of letters, and in indecent fonts, their _shape_ is wrong anyway.
    Thus, select a suitable list of _fonts_, if you are worried about quotation
    mark appearance. For example, don't use Verdana.

    > <span class="quote>&bdquo;</span>This is a quote<span
    > class="quote>&rdquo;</span>


    Which quotes are you actually using? Surely not English-style quotes. And
    not really German-style either. Even Duden's pages use wrong characters, but
    the correct closing quotation mark for German is &ldquo; and not &rdquo;
    (note that the _names_ of the characters are misleading and reflect English
    usage). This is relevant, since different quotes have different line
    breaking behavior.

    > My problem is now that the last quotation mark sometimes gets a
    > linebreak making it standing alone on the next line which - of course
    > - looks ugly.


    Please post a URL and specify the browser(s) tested.

    > Can I somehow glue it to the last word in the sentence ?


    If you are really using &rdquo; as a closing quote, you should not have
    problems with line breaks. But if you actually use &ldquo;, as you might
    need in several languages, then you can use

    &bdquo;This is a <nobr>quote&ldquo;</nobr><wbr>

    The <wbr> allows an immediate line break after &ldquo;, and this might be
    useful, since some browsers don't break there automatically (since they
    assume, so to say, that everyone uses &ldquo; as an _opening_ quotation
    mark). Specifically, if the closing quotation mark is followed by a space
    and an opening parenthesis "(" or "[", IE will not divide the text into
    lines so that the parenthetic expression starts on a new line.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, May 18, 2007
    #3
    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,291
    Matt Humphrey
    Oct 18, 2004
  2. Dirk Jagdmann

    prevent line break after form

    Dirk Jagdmann, Dec 27, 2005, in forum: HTML
    Replies:
    3
    Views:
    28,256
    Beauregard T. Shagnasty
    Dec 28, 2005
  3. kaushikshome
    Replies:
    4
    Views:
    753
    kaushikshome
    Sep 10, 2006
  4. Replies:
    12
    Views:
    938
  5. Replies:
    3
    Views:
    166
Loading...

Share This Page