On Wed, 22 Aug 2007, [EMAIL PROTECTED] wrote:

> I'm working for a company in which the boss (who's originally from the
> print industry) insists on having equal line lengths in the browsers on
> different operating systems.

Sounds rather odd in several accounts, but on this list, we're supposed to 
discuss the "how to" part. Even for that, a more specific description 
(statement by the boss, I suppose) is needed. What is "equal line 
lengths"? In pixels, millimeters, characters, something else?

> So in an example text, "hello, i'm example text!", if the text is split to
> the following line at "example" on Firefox Windows, it must be split at
> "example" in Firefox Mac/Safari as well.

That's really not possible. A program cannot do what its fellow program is 
doing on another platform. Besides, line division generally depends on a 
multitude of factors, and an operating system is hardly one of them 
(though one of the factors might be differences between versions of a 
browser for different operating systems).

However, it is possible to do the following, which might (or might not) be 
what the boss really means: Make the text behave so that it either stays 
on one line or gets divided before the word "example".

In HTML you could do this in two ways, the first of which is nonstandard
but well supported too:

<nobr>hello, i'm</nobr> <nobr>example text!</nobr>

hello,&nbsp;i'm example&nbsp;text!

(Instead of &nbsp; you can type the no-break space character if you know 
how to do that.)

In CSS, you would essentially need markup like first alternative:

<span class="nobr">hello, i'm</span> <span class="nobr">example 
text!</span>

together with CSS code

  .nobr { white-space: nowrap; }

> On Windows, I had to resort to inserting manual line-breaks where the boss
> wants the split which are not honoured on Safari for example.

I'm not sure I understand the statement. Surely the <br> tag is honored by 
all visual browsers. It has no well-supported CSS counterpart, but I don't 
think that's important. The issue is whether forced line breaks are a good 
idea; the way to create them is not very important.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to