Set the font size for a <p> element to "xx-large":
The fontSize property sets or returns the font size of the text.
The fontSize property is supported in all major browsers.
Return the fontSize property:
Set the fontSize property:
Value | Description |
---|---|
xx-small x-small small medium large x-large xx-large |
Sets the size of the font to different fixed sizes, from xx-small to xx-large |
smaller | Decreases the font-size by one relative unit |
larger | Increases the font-size by one relative unit |
length | Defines the font-size in length units |
% | Sets the font-size to a % of the parent element's font size |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | medium |
---|---|
Return Value: | A String, representing the font size of the text in the element |
CSS Version | CSS1 |
A demonstration of possible values:
Return the font size of a <p> element:
CSS tutorial: CSS Font
CSS reference: font-size property
HTML DOM reference: font property