GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — <relative-size> CSS type - CSS | MDN

<relative-size> CSS type

The <relative-size> CSS data type describes relative size keywords. The <relative-size> keywords define a size relative to the computed size of the parent element. This data type is used in the font shorthand and font-size properties.

Syntax

<relative-size> = smaller | larger

Values

The <relative-size> data type is defined using a keyword value chosen from the list below.

smaller

A relative size one size smaller than the inherited size.

larger

A relative size one size larger than the inherited size.

Description

The <relative-size> keywords are relative to the current size of the element. If the inherited size is defined using an <absolute-size> keyword, the <relative-size> value equates to the adjacent size in the <absolute-size> table. Otherwise, the relative increase or decrease in size is between 120% and 150%.

Examples

Comparing the keyword values

html
<ul>
  <li class="smaller">font-size: smaller;</li>
  <li>font-size is not specified</li>
  <li class="larger">font-size: larger;</li>
</ul>
css
li {
  margin-bottom: 0.3em;
}
.smaller {
  font-size: smaller;
}
.larger {
  font-size: larger;
}

Result

Specifications

Specification
CSS Fonts Module Level 4
# valdef-font-size-relative-size

See also

  • CSS <absolute-size> data type
  • CSS font and font-size properties
  • CSS fonts module

Help improve MDN

Learn how to contribute

This page was last modified on Apr 20, 2026 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.