Ask Your Question
1

Is it possible to apply the font shorthand to use the identical font as the h1 tag without reiterating the font size?

asked 2021-08-04 11:00:00 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-06-12 08:00:00 +0000

plato gravatar image

Yes, it is possible to apply the font shorthand to use the identical font as the h1 tag without reiterating the font size. Here is an example:

h1 {
  font-family: Arial;
  font-size: 36px;
  font-weight: bold;
}

p {
  font: bold Arial;
}

In the above code, the font shorthand for the p tag uses the same font family and weight as the h1 tag (Arial and bold), but does not include the font-size property. Therefore, the font size for the p tag will inherit the font-size from its parent element or default to the browser’s default size.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-08-04 11:00:00 +0000

Seen: 10 times

Last updated: Jun 12 '21