Make button width fit to the text

后端 未结 8 645
一生所求
一生所求 2020-12-29 20:29

While I was fiddling with this \'Fancy 3D Button\' example, I found that the width seemed to be hard-coded to fit the text\'s width.

Here is the HTML /

8条回答
  •  不思量自难忘°
    2020-12-29 21:29

    If you are aiming for maximum browser support, modern approach is to place button in a div with display:flex; and flex-direction:row; The same trick will work for height with flex-direction:column; or both height and width(will require 2 divs)

提交回复
热议问题