开发者

Centering html elements

开发者 https://www.devze.com 2022-12-30 06:10 出处:网络
I am making an ASP.NET web control. In a table, how can I center a b开发者_如何学运维utton? ThanksIf you want to center an inline element set the container to:

I am making an ASP.NET web control. In a table, how can I center a b开发者_如何学运维utton?

Thanks


If you want to center an inline element set the container to:

text-align:center; eg:
<div style="text-align:center;"><input type="submit" value="Center Me!"></div>

If you want to center a block level element set it to:

margin:auto; eg:
<div style="margin:auto;">Im in the middle</div>


Easiest way is to put

<td align="center">
  --content here--
</td>


This is very simple ..

 <div>
         //your html code ..
         <table>
                 //data inside the table ..
                 <button align="center"> Click here </button>        
         </table> 
    </div>
0

精彩评论

暂无评论...
验证码 换一张
取 消