Change the HTML space between lines.

Yamja
Tera Guru

Hi,

 

I have a requirement that reduce the space between lines in HTML field.

Can someone please let me know how can achieve this.

I tried change the HTML source code from<p>text</p> to <br>text</br>, But still getting the line space for new lines.

Yamja_0-1698943292932.png

and the HTML field data look like this

Yamja_1-1698943360039.png

 

Please some one help me and I want this functionality in all HTML fields

 

Thanks

Theja

 

 

1 ACCEPTED SOLUTION

Yamja
Tera Guru

Hi,

I found the solution for reducing line space.

Wrote below script to force HTML editor from P to br

"function onLoad() {
//Type appropriate comment here, and begin script below
addAfterPageLoadedEvent(function() {


tinymce.EditorManager.editors[0].settings.force_br_newlines = true;


tinymce.EditorManager.editors[0].settings.force_p_newlines = false;


tinymce.EditorManager.editors[0].settings.forced_root_block = "";


});
}"

Thank you for your responses.

View solution in original post

6 REPLIES 6

Jaspal Singh
Mega Patron
Mega Patron

Hi,

Remove the <p> and </p>tags and replace it with <br>

 

Hi Jaspal,

by replacing <p> with <br> might reduce the space, but this happens after I write the text in HTML. Please let me know where can I go and change the code to get less line space before we write(for new data entry) something in HTML.

Prince Arora
Tera Sage
Tera Sage

@Yamja 

 

<p> tag has its own specified css, so you can do one thing use like below:

 

testing of this story </br>
is not provided by theja </br>
text value

Don't use any tag for the content

 

If my answer solved your issue, please mark my answer as  Correct & 👍Helpful based on the Impact.

Sandeep Rajput
Tera Patron
Tera Patron

@Yamja Use line-height attribute in paragraph css to adjust the spacing between lines in a paragraph.

 

<p style="line-height: 0.8">
This is a paragraph with a standard line-height.<br>
The default line height in most browsers is about 110% to 120%.<br>
</p>

Hope this helps.