Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
Resize font-size based on determinated px and box width with js

I need to resize the font-size (like vw) of my tag p with a based size of 16px, in proportion on her box resize. 16px in vw is equal to 1.119vw, but this is the 100% of width; in my case I need the 50% of vw.

<div class="box"> 
 <p> Resize my text </p>
</div>
.box {
 width: 50%;
}

p {
 font-size: 16px;
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

since you don't provide clear expectations. you can do something like:

font-size: calc(1.119vw / 2);

to calculate a font-size in pixel depending on vw then divide by 2 to achieve this.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!