css - sizing a container based on the content -


the following screen shot of content part of form validation in website project that's in development phase:

enter image description here

this content contained in div specifies width 20%. prior adding rule div stretched horizontally across entire screen looked excessive short messages contained within. there way let div (or other appropriate container) automatically adjust width wide enough content contains?

you can display: inline-block or float. here demo http://codepen.io/anon/pen/vdicu/


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -