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

229
Views
My span width expands to right but I want it to expand left and auto fit my content inside the span tag

Please click the image https://i.stack.imgur.com/HtSK6.jpg so that you understand I have marked the problem in red I want that time to automatically adjust width for example if the time is 1:25:34 then it expands to left and fill the content without overflowing. I hope you understood my css code which I have written is given below:

<span className="time">{props.time}</span> 
time{
    background-color: black;
    color: white;
    position: absolute;
    top: 8.4rem;
    left: 15.9rem;;
    font-weight: bold;
    height: fit-content;
    font-size: 0.9rem;
   
    width: fit-content;
    
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Your question isn't too clear, but looking at your code it seems like you using a internal Css but it isn't in a style container Make sure all CSS codes are placed into style then into head

about 4 years ago · Juan Pablo Isaza Report

0

Since you want your container to be flexible, so as to fit into the box when it shows both the hours, minute and second, then you just add padding. This will create a gap between the text area and the borders.

Make sure to ignore width too as width is flexible

Hope this helps 👍

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!