CSSによるフォントサイズの指定方法 font: normal 1.25em/1.5em MuseoSans,sans-serif;

無職からフリーターになったことだし気分を変えようと思いブログのテーマを変更していたところ、見たことのないCSSのフォントサイズの指定方法があったので調べてみました。

font: normal 1.25em/1.5em MuseoSans,sans-serif;

一見、フォントサイズを分数で指定しているように見えました。

CSS Shorthand Properties For example, if you needed to style your fonts and you wanted to apply a font-size, line-height, weight, style, and family, you would need to have at least 5 lines of CSS.
p {
  font-size: 1.25em;
  line-height: 1.5em;
  font-weight: bolder;
  font-style: italic;
  font-family: "Times New Roman";
}
If you use the shorthand font property you can reduce this to one line of CSS.
p {font: bolder italic 1.25em/1.5em "Times New Roman"; }

最初の1.25emがfont-sizeの指定で、後ろの1.5emがline-heightの指定らしいです。 CSSも深いな。

4件のコメント

コメントする

メールアドレスが公開されることはありません。 が付いている欄は必須項目です


The reCAPTCHA verification period has expired. Please reload the page.

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください