Jump to content
Huseyin SEKER

linebreak in firefox

Recommended Posts

Hi,

I'm trying to add newlines with code for example:

W3Label1.Caption:='today<br><br><br>weather<br>sunny';

in chrome the result is as expected:
today


weather
sunny

BUT in firefox (old or newest version it's the same) the result is not correct as below:

today
weather
sunny.

I added three <br> but it only makes 1 linebreak, why? How can i solve this? I tried #13#10 and it didn't work on chrome or firefox either.

Share this post


Link to post
Share on other sites

If you want to do tricks like these, you should use a TW3DIVHtmlElement instead of a TW3Label. Using br -tags to add space between paragraphs is also not recommended:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br says:

Note: Do not use <br> to create margins between paragraphs; wrap them in <p> elements and use the CSS margin property to control their size.

So, using a div you can do for example:

W3DIVHtmlElement1.InnerHtml:='<p>today</p><p></p>weather<br>sunny';

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...