79342710

Date: 2025-01-09 13:11:30
Score: 0.5
Natty:
Report link

Fist of all add something like

width: max-content;
height: max-content;

to the parent (.house) so this won't happen: size

after that just position the child relative (%)

.temp {
  font-size: 25px;
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, -50%);    
}

house

I changed the vertical center to px for this example (because the middle of the house is not in the center):

.temp {
  font-size: 25px;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 0);
}
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Waradu