html - how to force a div tag to not do a line break? -
i have div tag contains url inside. after external format ends come line breaks (carriage return, line feed) interpreted white space in html*. like
yacrlr hoo.com
and in html preview shows:
ya hoo.com
do have idea how force avoid line break in advance insight may have.
if html document contains line break in element content, in
<div> ya hoo.com </div> as seem saying, cannot prevent line break being taken whitespace, in html or css. can affect (in css) way whitespace handled (e.g., whether line breaks cause line breaks in rendering or inter-word space), not include “ignore it” option.
well, there tricky , risky way of setting word-spacing negative value expected cancel effect of spaces.
<div style="word-spacing: -0.25em"> ya hoo.com </div> the typical width of space 0.25em, varies font. , affect (“neutralize”) all whitespace in element.
it easy remove line breaks javascript, once have specified line breaks removed where. better modify process generates html document in first place.
Comments
Post a Comment