Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.