how to make this div responsive ?

this is just a tag how can i make it responsive ? is it even possible i mean there should be padding / margin according to text length. how can i do that ? first image is the one i made and second is the design
No description
No description
8 Replies
Chris Bolson
Chris Bolson3w ago
You can achieve this with flex
peterpumkineaterr
i'm using flex let me send codepen
clevermissfox
clevermissfox3w ago
The flex-grow:1 and width:100%; on both; also you don’t need to declare flex-direction:row as that’s the default when adding display:flex as well as not necessary to declare flex-shrink:1 which is also the default;
peterpumkineaterr
I will try that in the morning
snxxwyy
snxxwyy2w ago
add flex-wrap: wrap; to the container and take off width: 100%; on the children. They will then wrap when the screen can't fit both of them next to eachother.
peterpumkineaterr
damn this worked !! thank you so much.
snxxwyy
snxxwyy2w ago
No worries
Want results from more Discord servers?
Add your server