How to prevent line break ?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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

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 ?


Re: How to prevent line break ?

thogra wrote:

Quoted text here. Click to load it

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

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 /
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux

Re: How to prevent line break ?

Scripsit thogra:

Quoted text here. Click to load it

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

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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

Quoted text here. Click to load it

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")

Site Timeline