Saturday 15 September 2012

html - css min-width and auto width combination -



html - css min-width and auto width combination -

i want div minimum of width auto extend if content more. have tabbed menu options in form of short codes , each alternative of 2 characters. there options can span 3, 4 or more characters. whenever alternative of more 2 characters shown, div should expand automatically. have done 1 time in javascript don't want utilize here because have many items , looking css based solution.

i have tried min-width , auto width @ same time not work.

following code:

.inner{ width:auto; min-widht:23px; margin:2px 2px 2px 2px; height:23px; border: 3px solid #a3a0fa; border-radius: 1px; text-align:center; box-shadow: 0px 1px 1px transparent inset, 0px 0px 8px transparent; padding-left:5px;//added after posting question, works me padding-right:5px;//added after posting question, works me } <div class="inner">ab</div> <div class="inner">abcd</div> <div class="inner">abc</div>

thanks in advance!

html css width

No comments:

Post a Comment