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

254
Views
css grid row height bound to view width

For any element this works perfectly height: clamp(100px, 2.5vw, 150px) which sets a minimum,a growing rate and a maximum height. How could we implement the clamp(MIN, VAL, MAX) css function to a row height ?

body {
  background: whitesmoke;
  border: solid black 1px;
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-rows: 125px;
  gap: 10px;
  padding: 10px;
}

.box {
  background-color: tomato;
}
<!DOCTYPE html>
<html lang="en">

<head>

</head>

<body>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>

</body>

</html>

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Do you mean like this? Setting box to 100% height and then just using the clamp property in grid-template-rows.

body {
  background: whitesmoke;
  border: solid black 1px;
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-rows: clamp(300px, 3vh, 800px);
  gap: 10px;
  padding: 10px;
}

.box {
  background-color: tomato;
  height: 100%;
}
<!DOCTYPE html>
<html lang="en">

<head>

</head>

<body>
  
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>

</body>

</html>

about 4 years ago · Santiago Gelvez 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!