VBBRett
asked on
How do you center a label using CSS?
I am trying to center a label using CSS in a user control but for some reason it is not working. Here is what I have:
<div id="headertag" style="width:500%; margin-left:auto; margin-right:auto;">
<div id="subheadtag" style="width:300px; margin-left:auto; margin-right:auto;"
runat="server">
<asp:Label ID="lblsandmed" style="font-weight:bold; margin-left:auto; margin-right:auto;" runat="server">THIS IS A HEADER LABEL</asp:Label>
</div>
</div>
What is it that I am doing wrong in order to center this header label? I thought margin-left:auto; margin-right:auto; was supposed to
<div id="headertag" style="width:500%; margin-left:auto; margin-right:auto;">
<div id="subheadtag" style="width:300px; margin-left:auto; margin-right:auto;"
runat="server">
<asp:Label ID="lblsandmed" style="font-weight:bold; margin-left:auto; margin-right:auto;" runat="server">THIS IS A HEADER LABEL</asp:Label>
</div>
</div>
What is it that I am doing wrong in order to center this header label? I thought margin-left:auto; margin-right:auto; was supposed to
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER