Line break in the mailto onclick

后端 未结 2 1830
盖世英雄少女心
盖世英雄少女心 2020-12-30 01:19

The code below works great except the email has all the text on one line like this: Height: 60 | Diagonal: 123 | Width: 107 | Total SF: 13.92 | Cost Per SF: 450 | Total Cos

相关标签:
2条回答
  • 2020-12-30 01:31

    You need to use the ASCII values for line feed/carriage return:

    %0A = \n
    
    %0D = \r
    
    %0D%0A = \r\n
    

    Works like a charm.

    <a href="mailto:person@somedomain.com?subject=My subject&body=Hello %0D%0A World">Link</a> 
    

    (Spaces added around %0D%0A for clarity. In reality, this could add unwanted white space.)

    0 讨论(0)
  • 2020-12-30 01:35

    try using <br/> as a line break

    0 讨论(0)
提交回复
热议问题