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

206
Views
I can't vertically align to bottom a font size of several em values

I want G to stick to the bottom of it's parent. (G to the bottom of the white background).

body {
  position: relative;
  background: #ccc;
  font-size: 2em;
  padding: 3em;
}

.staff {
  display: flex;
  padding: 1em;
  background: white;
  width: 100%;
  position: absolute;
  top: 50%;
  left: 0;
}

.staff span {
  position: absolute;
  bottom: 0;
  font-size: 1.008em;
}

.clef {
background: pink;
  font-size: 0.25em;
  vertical-align: 'bottom';
}
<div class='staff'>
<span class='clef'>G</span>
</div>

I also tried display: flex; align-items: flex-end; but didn't work

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

body {
  position: relative;
  background: #ccc;
  font-size: 2em;
  padding: 3em;
}

.staff {
  display: flex;
  padding: 1em;
  background: white;
  width: 100%;
  position: absolute;
  top: 50%;
  left: 0;
  
}

.staff span {
}

.clef {
  
  position: absolute;
  bottom: 0; 
  font-size: 1.008em;
  background: pink;
  line-height: 0.7;
  /* font-size: 0.25em; */
  vertical-align: "bottom";
}
<div class='staff'>
<span class='clef'>Good</span>
</div>

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!