CSS: Percentage Value

By Xah Lee. Date: .

% is percentage.

Example:

div {width:5%}

Percentage is not technically considered a “length unit”.

Meaning of percent value is dependent on the specific property.

css percentage K4p46
Syntax and basic data types#percentage-units

[see HTML: the Root Element]

TIP: don't use percentage value, because its meanings is complex. Use vw, vh, vmin, vmax instead.

back to CSS: Length Units

CSS Basics


CSS

Basics

Selectors

Color

Font

Text Decoration

Box Model

Box Decoration

Layout

Layers

Transform/Animation

Line Wrap

Misc