How to adjust the line height on html field

sachinbhasin11
Tera Guru
Tera Guru

Hi Experts, 

Anyone knows how to adjust the line height of an html field

I want to fix the line spacing to 1.5 i.e. Line height attribute in CSS however not sure how to do it on text field of knowledge article  

1 ACCEPTED SOLUTION

sachinbhasin11
Tera Guru
Tera Guru

I found the answer to this 

 

Since kb_view is a UI Page we need to create a new Custom CSS Style sheet in CMS Application and then call the custom CSS inside the HTML code of this UI Page 

Make sure your custom CSS is overriding those elements only that you may want to change. In my case it was a line-height element that was set to 1.4 by out of the box CSS Style sheet

PS : The out of the box CSS Style sheet is native to platform so you may not be able to access it  

View solution in original post

2 REPLIES 2

Raj68
Mega Guru

Hi sachin,

try below code:

.container {
  line-height: 2.5ex;
  height: 7.5ex; /* 2.5ex for each visible line */
  overflow: hidden;
}
or

div.a {
  line-height: normal;
}

div.b {
  line-height: 1.6;
}

div.c {
  line-height: 80%;
}

div.d {
  line-height: 200%;
}

you can take help from below link also

https://developer.mozilla.org/en-US/docs/Web/CSS/line-height

https://www.w3schools.com/cssref/pr_dim_line-height.asp

https://css-tricks.com/fun-line-height/

https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align

NOTE: Mark correct or helpful if it helps you.

 Warm Regards,

Raj patel

 

sachinbhasin11
Tera Guru
Tera Guru

I found the answer to this 

 

Since kb_view is a UI Page we need to create a new Custom CSS Style sheet in CMS Application and then call the custom CSS inside the HTML code of this UI Page 

Make sure your custom CSS is overriding those elements only that you may want to change. In my case it was a line-height element that was set to 1.4 by out of the box CSS Style sheet

PS : The out of the box CSS Style sheet is native to platform so you may not be able to access it