How to make the following div responsive?
HTML code :
8 Replies
I think as long as you don't have a fixed width on your div, it will be responsive. you could use for example max-width:500px; or whatever.
But, the text would eventually overflow the div. so to prevent this, you could use font-size with clamp.
The best tool to generate a font-size with clamp that i have found is https://clamp.font-size.app/
Font-size clamp() generator
Generate linearly scale font-size with clamp()
just fyi there is an option to use
:nth-child(even)
or :nth-child(odd)
instead of using classes on the spans 🙂what about the picture?
when I use position absolute I lost the responsiveness of the picture
show us your code in code pen 😉
https://codepen.io/manishkarke/pen/QWJvVyr
I used svg instead of img tag so I messed up more.
please help me in this
something like this ?? https://codepen.io/MannixMD/pen/BaGROvP
you may need to play with the font size a bit
yes