line-height-step
Quick Summary for line-height-step
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Code Usage for line-height-step
/* Point values */ line-height-step: 18pt;  /* Global values */ line-height-step: inherit; line-height-step: initial; line-height-step: revert; line-height-step: unset; 
More Details for line-height-step

line-height-step

Experimental: This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.

The line-height-step CSS property sets the step unit for line box heights. When the property is set, line box heights are rounded up to the closest multiple of the unit.

/* Point values */ line-height-step: 18pt;  /* Global values */ line-height-step: inherit; line-height-step: initial; line-height-step: revert; line-height-step: unset; 

Syntax

The line-height-step property is specified as any one of the following:

a <length>.

Values

<length>

The specified <length> is used in the calculation of the line box height step.

Formal definition

Initial value0
Applies toblock containers
Inheritedyes
Computed valueabsolute <length>
Animation typediscrete

Formal syntax

<length>

Examples

Setting step unit for line box height

In the following example, the height of line box in each paragraph is rounded up to the step unit. The line box in <h1> does not fit into one step unit and thus occupies two, but it is still centered within the two step unit.

:root {   font-size: 12pt;   --my-grid: 18pt;   line-height-step: var(--my-grid); } h1 {   font-size: 20pt;   margin-top: calc(2 * var(--my-grid)); } 

The result of these rules is shown below in the following screenshot:

Specifications

Specification
CSS Rhythmic Sizing # line-height-step

See also

font font-size line-height

Last modified: Sep 8, 2021, by MDN contributors

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
“If you just sit and observe, you will see how restless your mind is. If you try to calm it, it only makes it worse, but over time it does calm, and when it does, there’s room to hear more subtle things. You see so much more than you could see before. It’s a discipline; you have to practice it.”
Steve Jobs
Random CSS Property

outline-width

The CSS outline-width property sets the thickness of an element's outline. An outline is a line that is drawn around an element, outside the border.
outline-width css reference