whitespace - Avoid line break between html elements -


i have <td> element:

<td><i class="flag-bfh-es"></i>&nbsp;+34&nbsp;666&nbsp;66&nbsp;66&nbsp;66</td> 

i hoping keep single line, get:

enter image description here

as can see, flag , telephone number in separate lines. &nbsp; working in between numbers of telephone number, not between flag , telephone number.

how can make sure no line-break @ introduced renderer?

there several ways prevent line breaks in content. using &nbsp; 1 way, , works fine between words, using between empty element , text not have well-defined effect. same apply more logical , more accessible approach use image icon.

the robust alternative use nobr markup, nonstandard universally supported , works when css disabled:

<td><nobr><i class="flag-bfh-es"></i> +34 666 66 66 66</nobr></td> 

(you can, need not, use &nbsp; instead of spaces in case.)

another way nowrap attribute (deprecated/obsolete, still working fine, except rare quirks):

<td nowrap><i class="flag-bfh-es"></i> +34 666 66 66 66</td> 

then there’s css way, works in css enabled browsers , needs bit more code:

<style> .nobr { white-space: nowrap } </style> ... <td class=nobr><i class="flag-bfh-es"></i> +34 666 66 66 66</td> 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -