How to prevent line break ?

T

thogra

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
 
T

Toby A Inkster

thogra said:
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; }
 
J

Jukka K. Korpela

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top