#Restrict text to stay within some constraints as I expand it

2 messages · Page 1 of 1 (latest)

ashen meteor
#

Easy answer is to give some kind of max-width to .card

The reason this is happening is because of the fact that you've absolutely positioned your element at 50% of it's parent, this will effectively force the .card to be 50% of the parent's width (in this case the parent is the window because the root is NOT a positioned element) because by default it would be 100% (div's are block elements) and so it "natively" wants to take up the remaining 50% of the space... so as you expand the parent that also grows the .card because it will remain as 50% of it's parent width...

ashen meteor
#

I'm not saying absolute is a problem I'm just saying that this combined with the position is what's causing the problem...