Questions tagged [line-height]
64 questions
1
vote
0 answers
Android - Line height inconsistent on a TextView if using Bold or TypefaceSpan
I am building a reader app and have a custom class that expands a TextView with code to deal with pagination etc. The text is set from an Html format using
Html.fromHtml(text, Html.FROM_HTML_MODE_COMPACT, HtmlImageGetter(this, binding.textSurface,…

kennydead
- 11
- 2
1
vote
0 answers
TextStyle lineHeight does not work for single line text
I am setting TextStyle to my Text composable, but when the text is multi-line, only then the line height works as expected.
But, in case the text is single line, line height is not applied to it.
When I checked the documentation of TextStyle, I got…

Ali_Waris
- 1,944
- 2
- 28
- 46
1
vote
2 answers
CSS - inline SVG interferes with line-height?
I'm struggling to understand the the following css behavior. Maybe I'm missing something important because this actually seems like a simple scenario to me. Consider the following example:
.container {
background-color: lime;
font-size: 20px;
…

Giraphi
- 1,383
- 1
- 11
- 26
1
vote
1 answer
Different space to top on mobile devices - How to fix?
I want certain words to be highlighted with a background color on headings. So I am using in my headings like
Ihre Vorteile bei uns
In CSS I have added: h2.sppb-title-heading span{ background:…
Martin Kares
- 13
- 2
1
vote
4 answers
I can't remove the space above and below a paragraph
I can't remove the space above and below a paragraph that only consists of the letter "I" at the top of my Web Page.
I have already tried to remove it with the "margin" and "padding" properties but it is not changed. Also I have tried, for the…

Israel
- 25
- 6
1
vote
0 answers
1
vote
0 answers
Why does a heading have a larger height when its line-height is set and it has a span with smaller font?
Here is my code:
div {
border: thin solid gray;
display: inline-block;
}
h1 {
background: lightblue;
}
span {
background: orange;
}
.b h1 {
line-height: 1.2em;
}
.c span {
font-size: 0.5em;
}
.d h1 {
line-height: 1.2em;
}
.d span {
…

Lone Learner
- 18,088
- 20
- 102
- 200
1
vote
1 answer
Where do I need to apply line-height for it to take effect?
I have a div that appears like this:
I want to reduce the kerning between the lines. I tried adding a line-height directive to both the encompassing div and then to one of the label elements like so:

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
1
vote
1 answer
SwiftUI: fit SF Icon into line height
When I try to display an icon next to a text, the Image adds unwanted space above, increasing the line height and I don't understand how I can control it. I tried frame, padding, resizable without success. I also tried the Label element, which my…

Ti Hausmann
- 926
- 8
- 21
1
vote
1 answer
Avoid extra space in anchor caused by line height - flex layout
I have this set of boxes with links and they are displayed as flex items. The problem is that the coverage of the clickable area(yellow area) is not consistent due to the height of each box. Setting the line height of anchor tag to zero will fix the…

Jayonline
- 143
- 11
1
vote
0 answers
default line-height setting truncates Segoe UI
Chrome is truncating the display of Segoe UI when used with a line-height of 1.15 (default setting of normalize.css) This behaviour does not occur on Firefox
This is best illustrated via a screenshot (zoomed in instead of using larger fonts)
You…

wal
- 17,409
- 8
- 74
- 109
1
vote
1 answer
Why is line-height set in px affected by parent’s font-size?
I've made this example: http://codepen.io/tomsoderlund/pen/JYJpPR to demonstrate.
I’m setting the font-size (=size of 1 em) on the parent (.canvas) using:
$('.canvas').css('font-size', emSize + 'px');
Both the font-size and line-height are set in…

Tom Söderlund
- 4,743
- 4
- 45
- 67
0
votes
1 answer
Some line-height values on inline elements results in strange container heights
Consider the following code (an inline contained within a block-level
):
HELLO
This will result in the having a height of 19px. How did the browser arrive at…

user3163495
- 2,425
- 2
- 26
- 43
0
votes
1 answer
Decrease line-height
I'm trying to do a paragraph highlighted by quote marks, and I want the quote marks to be bigger than the text in the paragraph. so what I have right now is
.quote {
font-style: italic;
margin-bottom: 20px;
}
.quote:before {
content:…

okokokokokokokok
- 33
- 4
0
votes
2 answers
How can I make the text the same height as the box
I got the 2 div boxes and I want the text to be the same height as the box.
I tried setting 2rem for both the font-size and the box height. Obviously that is not how I make text and box the same height.
…

HarpoBrothers
- 3
- 1