开发者

Centering html elements

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜