20
Jun
2005

Standard Compliant Alternative to WBR Tag

The WBR tag marks a place where a line break can take place. It does not necessarily always result in a line break; rather, it says that line breaks are allowed at this place.
but it is not part of any HTML standard.

A possible solution is to insert a space, that is very small, and (almost) invisible. On IE/PC and Safari you can't see it at all, and on Opera and Mozilla you realy need good eyes to see any space (but there is one)

The solution is to insert a space surrounded by a span tag, that is styled with width:0; and font-size: 1px;

We need to use 1px for the font-size, because some browsers (sfarai) will ignore a font-size set to 0.

Example:

someverylongword<span style="width:0;font-size:1px;font-size:0px;"> </span>thatcouldbreakyourlayout

Test:
somevery longwordthatgoesonandonand thatcouldbreakyourlayout

UPDATE:
There is also another alternative: &shy; and &#8203;

quirksmode.org wbr compatibility test
quirksmode.org article
blog comments powered by Disqus
logo

Mat's Blog

California Dreaming

Users Status

You are not logged in.

Search

 

Get Firefox

Get Firefox!

Currently Reading


William Gibson, Jarreth Merz, Matthias Scherwenikas
Neuromancer, 3 Audio-CDs

Archive

June 2005
Sun
Mon
Tue
Wed
Thu
Fri
Sat
 
 
 
 1 
 2 
 4 
 5 
 6 
 7 
 8 
 9 
10
11
12
13
14
15
16
17
18
19
21
22
24
25
26
27
28
29
30
 
 
 

Recent Updates

und wie sieht es mit...
und wie sieht es mit deiner privaten Hochzeit aus? ;-) wünsche...
flog - 23. Oct, 20:49
Danke!
Danke Matthias für deinen Beitrag zu diesem Schritt....
Sierra - 22. Oct, 12:44
Ja, das Offline Problem...
Ja, das Offline Problem ist auch mein Hauptproblem....
matthias - 23. Sep, 14:36
ich verwende am Mac ausschließlich...
ich verwende am Mac ausschließlich die Browser...
smeidu - 23. Sep, 14:22
Stimmt -
Den Eindruck kann ich nur bestätigen; in der Bedienung...
N_Haase - 29. Jul, 13:24
Dach
und da oben am Dach, da sollte doch seit Jahren eine...
Sierra - 12. Jun, 10:47
but yammer accepts
no Austrian mobile numbers :(
cqeb - 15. Dec, 23:45
das verpasse ich leider......
das verpasse ich leider... http://twitter.com/flog/st atus/998712029
flog - 10. Nov, 21:38

Status

Online for 3473 days
Last update: 3. Mar, 15:52

Credits

vi knallgrau GmbH

powered by Antville powered by Helma


Creative Commons License

xml version of this page

twoday.net AGB