Could someone please let me know how to center a Login control on a page?
Can I use CSS to do that?
Thanks,
Dan
You could use the CssClass property of the login control to style your
login control and position it:
<asp:Login runat="server" id="myLogin" CssClass="myClass"></asp:Login>
Additionally, you could also wrap your LoginControl in a div and then
position your div on the page wherever you'd like it using a css class
<div class="myClass"><asp:Login runat="server" id="myLogin"></
asp:Login></div>
<center>
Login controls
</center>
it works for me
"dan" <d...@company.com> wrote in message
news:OUnMc4rr...@TK2MSFTNGP02.phx.gbl...
[top-posting corrected]
>> Could someone please let me know how to center a Login control on a page?
>>
>> Can I use CSS to do that?
>
> Or you could use this;
>
> <center>
> Login controls
> </center>
The <center> tag has been deprecated for ages and should not be used...
> it works for me
On what browser(s) / platform(s) have you tested it...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
I'm still strugling with it. The css applied to the login control seems to
re-arrange controls within the login but does not actually center the
'whole' login control. Would you able to provide a simple example?
Thanks,
Dan
"ADN" <vcua...@gmail.com> wrote in message
news:969ccc3b-b233-45cf...@26g2000hsk.googlegroups.com...
If your css class moves all of the controls around, then you could try
the second approach of wrapping the login control in a div like so:
<style>
.myClass{ margin-right: 25%; }
</style>
<div class="myClass"><asp:Login runat="server" id="myLogin"></
asp:Login></div>
I agree with Mark, you shouldn't be using a <center> tag at all. It's
bad practice and it probably isn't browser compatible with all
browsers.
"dan" <d...@company.com> a écrit dans le message de news:
OUnMc4rr...@TK2MSFTNGP02.phx.gbl...
The above link will help you in accomplishing your task :)
>> On Monday, May 05, 2008 11:45 AM Rob Eventine wrote:
>> Or you could use this;
>>
>> <center>
>> Login controls
>> </center>
>>
>> it works for me
>>> On Monday, May 05, 2008 11:53 AM Mark Rae [MVP] wrote:
>>> "Rob Eventine" <btb...@ntlworld.com> wrote in message
>>> news:xYFTj.8282$WA5....@newsfe6-gui.ntli.net...
>>>
>>> [top-posting corrected]
>>>
>>>
>>> The <center> tag has been deprecated for ages and should not be used...
>>>
>>>
>>> On what browser(s) / platform(s) have you tested it...?
>>>
>>>
>>> --
>>> Mark Rae
>>> ASP.NET MVP
>>> http://www.markrae.net
>>>> On Monday, May 05, 2008 1:01 PM dan wrote:
>>>> Thanks for the reply.
>>>>
>>>> I'm still strugling with it. The css applied to the login control seems to
>>>> re-arrange controls within the login but does not actually center the
>>>> 'whole' login control. Would you able to provide a simple example?
>>>>
>>>> Thanks,
>>>> Dan
>>>>
>>>> "ADN" <vcua...@gmail.com> wrote in message
>>>> news:969ccc3b-b233-45cf...@26g2000hsk.googlegroups.com...
>>>>> On Monday, May 05, 2008 10:35 PM ADN wrote:
>>>>> Hi dan,
>>>>>
>>>>> You could use the CssClass property of the login control to style your
>>>>> login control and position it:
>>>>>
>>>>> <asp:Login runat="server" id="myLogin" CssClass="myClass"></asp:Login>
>>>>>
>>>>> Additionally, you could also wrap your LoginControl in a div and then
>>>>> position your div on the page wherever you'd like it using a css class
>>>>>
>>>>> <div class="myClass"><asp:Login runat="server" id="myLogin"></
>>>>> asp:Login></div>