Search
 
SCRIPT & CODE EXAMPLE
 

CSS

line-height css

/* Keyword value */
line-height: normal;

/* Unitless values: use this number multiplied
by the element's font size */
line-height: 3.5;

/* <length> values */
line-height: 3em;

/* <percentage> values */
line-height: 34%;

/* Global values */
line-height: inherit;
line-height: initial;
line-height: unset;
Comment

line-height css

.green {
  line-height: 1.1;
  border: solid limegreen;
}

.red {
  line-height: 1.1em;
  border: solid red;
}

h1 {
  font-size: 30px;
}

.box {
  width: 18em;
  display: inline-block;
  vertical-align: top;
  font-size: 15px;
}
Comment

css line-height default

body {
  line-height: normal; /* default */
  line-height: 1.5; /* number */
  line-height: 2em; /* length */
  line-height: 55%; /* percentage */
}
Comment

css good line height

/* paragraphs */
line-height: 1.5;

/* headings */
line-height: 1.25;
Comment

line-height css

<div class="box green">
 <h1>Avoid unexpected results by using unitless line-height.</h1>
  length and percentage line-heights have poor inheritance behavior ...
</div>

<div class="box red">
 <h1>Avoid unexpected results by using unitless line-height.</h1>
  length and percentage line-heights have poor inheritance behavior ...
</div>

<!-- The first <h1> line-height is calculated from its own font-size   (30px × 1.1) = 33px  --> 
<!-- The second <h1> line-height results from the red div's font-size  (15px × 1.1) = 16.5px,  probably not what you want -->
Comment

PREVIOUS NEXT
Code Example
Css :: repeating-linear-gradient 
Css :: overflow x not hidden 
Css :: css_background_img 
Css :: border image css 
Css :: color code for cyan 
Css :: gap css flex 
Css :: text flow top to bottom 
Css :: how to hide some grid items from grid in css 
Css :: move bullets in css 
Css :: scss percentage 
Css :: justify center wont wotk with max-width css 
Css :: vertical align css 
Css :: grid place between 
Css :: border buttom color 
Css :: rotate favicon css 
Css :: Disable text selection/highlight 
Css :: css prevent background scrolling 
Css :: @font-face css 
Css :: css banner image 
Css :: css table properties 
Css :: css no purple links 
Css :: hide page scrollbar css 
Css :: remove bg color with css 
Css :: background image opacity css 
Css :: flexbox navbar fixed top 
Css :: text change animation css 
Css :: how select two nt child with css 
Css :: font awesome center icon vertically and horizontally 
Css :: input type (submit, button, reset) css 
Css :: how to center icon vertically in react js 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =