Can someone provide assistance with flexbox resizing and expanding content within the same line without wrapping? I have multiple div elements, each 50px in length, arranged to appear as one continuous line. The odd milestone markings are displayed at the top of the line, while all even mile numbers are shown at the bottom. The number of miles varies dynamically based on server-side data.
My application allows for viewing pages in both desktop and mobile versions. When viewed on smartphones, I need the line to shrink proportionally along with the mile markings. I am seeking help with the following:
- When viewed from a desktop screen, I want each line's width set to 50 pixels.
- I do not want the line to stretch or shrink to fill the entire browser window if there are only a few mile markers displayed initially.
- When viewed on a smartphone, if the number of miles exceeds the available width, I want the line to shrink to fit them all on the same line.
I have tried adjusting the flex-shrink and flex-basis properties but have had no success. Any guidance would be greatly appreciated.
The issue I am facing is that when the page loads on a desktop browser, the line expands to the maximum width of the browser window. I want it to adhere to the width of each individual mile marker (50px) multiplied by the total number of miles displayed. If only a few miles are present, I do not want the line to stretch to the full width of the screen. Likewise, if the number of miles exceeds the screen width, I want the line to shrink accordingly.