Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 14px/26px font size in css do?

Tags:

css

I've been inspecting someone elses CSS and I noticed they are doing something I haven't seen before...

body {font:14px/26px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif}

What does the 14px/26px do? I've tried to google it but nothing seems to come up.

like image 273
Castles Avatar asked Jun 04 '10 00:06

Castles


People also ask

What does font-size do in CSS?

The font-size CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative <length> units, such as em , ex , and so forth.

What does font-size 12px mean?

The 12px is the height of the font in pixels. The 13px is the height of the line in pixels.

How do I change font-size in CSS?

To change the size of your text with inline CSS, you have to do it with the style attribute. You type in the font-size property, and then assign it a value.

What is font property in CSS?

The font property is a shorthand property for: font-style. font-variant. font-weight. font-size/line-height.


1 Answers

According to the CSS 2.1 Specifications for the font shorthand property:

15.8 Shorthand font property: the 'font' property

'font'
Value: [ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar | inherit

The first value is the font-size value, and the second value is the line-height value.

So font: 14px/26px ... means:

font-size: 14px;
line-height: 26px;
font-family: ...
like image 170
Pindatjuh Avatar answered Oct 13 '22 17:10

Pindatjuh