Thursday, 22 August 2013

How to center without the tag using CSS?

How to center without the tag using CSS?

I have some code that uses the tag to center two buttons on the screen:
<center>
<input type="button" onclick="parent.window.close();" value="Close
Window" id="Button1" name="Button1" />
<%
if (Session["MyRoleName"].ToString().ToUpper() == "SUPERMANADMIN")
{
%>
<input type="button" onclick="if (confirm('ARE YOU SURE? This cannot
be undone except by IT at great cost!')) { PurgeCourse(); }"
value="Purge Course Comments" id="Button2" name="Button2" />
<% } %>
</center>
Since the center tag is deprecated, I thought I'd try replacing it with a
<div> tag, and setting the margin to margin: 0 auto. This did not center
the buttons on the screen.
My question is, how can I center these two buttons on the screen,
horizontally, without using the <center> tag?

No comments:

Post a Comment