Search code examples
cssviewport-units

Are there any problems with giving both vw and vh properties for a single tag?


I have included the property as given below in the CSS:

p {
   font-size: 2.5vw; 
   font-size: 2.5vh;
}

Does this create any issues?


Solution

  • No, the value will simply be 2.5vh since it comes later. There is no special cascading behavior for any particular unit.