CSS font-size Property

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP




<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->




CSS font-size Property



Previous
Complete CSS Reference
Next



Example


Set the font size for different elements:




div.a
    font-size: 15px;


div.b
   
font-size: large;


div.c
    font-size: 150%;

Try it Yourself »


Definition and Usage


The font-size property sets the size of a font.














Default value: medium
Inherited: yes
Animatable: yes. Read about animatable
Try it
Version: CSS1
JavaScript syntax: object.style.fontSize="14px"
Try it


Browser Support


The numbers in the table specify the first browser version that fully supports the property.















Property
font-size 1.0 5.5 1.0 1.0 7.0





<!--
mid_content, all: [300,250][336,280][728,90][970,250][970,90][320,50][468,60]
-->




CSS Syntax



font-size:medium|xx-small|x-small|small|large|x-large|xx-large|smaller|larger|length|initial|inherit;

Property Values














































Value Description Play it
medium Sets the font-size to a medium size. This is default Play it »
xx-small Sets the font-size to an xx-small size Play it »
x-small Sets the font-size to an extra small size Play it »
small Sets the font-size to a small size Play it »
large Sets the font-size to a large size Play it »
x-large Sets the font-size to an extra large size Play it »
xx-large Sets the font-size to an xx-large size Play it »
smaller Sets the font-size to a smaller size than the parent
element
Play it »
larger Sets the font-size to a larger size than the parent element Play it »
length Sets the font-size to a fixed size in px, cm, etc. Read about length units
Play it »
% Sets the font-size to a percent of  the parent element's font size Play it »
initial Sets this property to its default value. Read about initial
Play it »
inherit Inherits this property from its parent element. Read about inherit


Related Pages


CSS tutorial: CSS Fonts


CSS reference: font property


HTML DOM reference:
fontSize property





Previous
Complete CSS Reference
Next

Popular posts from this blog

California

New York City

CNN