[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 29555
  • Last Modified:

How to align my button to the right of the screen

I have a web form and on one line I have some text, that is followed by a button. I need to have the button moved more to the right of the screen (Almost to the end of the right side of the screen). The problem is that I am not able to do this. I have even tried using many   commands but this does not work. ( I cut and pasted my code snippet below and the alignment is thrown off. Just just and paste into the IDE editor or notepad to get the alignment looking right for better readability.
<asp:Label ID="Label33" runat="server" Font-Bold="True" Font-Size="Large"                  ForeColor="#6699FF" Text="Seating Arrangement"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Label ID="Label39" runat="server" Font-Bold="True" Font-Size="Small" 
                ForeColor="#6699FF" Text="Pending Activation"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                
                <asp:Button ID="Button1" runat="server" BackColor="White" BorderColor="#3366CC" align="right"
                 BorderStyle="Ridge" Font-Bold="True" ForeColor="Black" 
                Text="Inactivate Arrangement" />

Open in new window

0
brgdotnet
Asked:
brgdotnet
3 Solutions
 
Praveen VenuCommented:
<table width="100%"><tr><td>
<asp:Label ID="Label33" runat="server" Font-Bold="True" Font-Size="Large"                  ForeColor="#6699FF" Text="Seating Arrangement"></asp:Label>      
                <asp:Label ID="Label39" runat="server" Font-Bold="True" Font-Size="Small"
                ForeColor="#6699FF" Text="Pending Activation"></asp:Label>            
                </td><td align="right">
                <asp:Button ID="Button1" runat="server" BackColor="White" BorderColor="#3366CC" align="right"
                 BorderStyle="Ridge" Font-Bold="True" ForeColor="Black"
                Text="Inactivate Arrangement" /></td></tr></table>
0
 
nmarunCommented:
Add the contents of your page into a table with the width of the table set to a 100% and in the last row, set the alignment to right and add the button in this row.

<table width="100%">
  <tr>
    <td>
        ... content here
    </td>
  </tr>
  <tr>
    <td>
        ... and here
    </td>
  </tr>
  <tr>
    <td align="right">
       <asp:Button ID="Button1" runat="server" BackColor="White" BorderColor="#3366CC" BorderStyle="Ridge" Font-Bold="True" ForeColor="Black" Text="Inactivate Arrangement" />
    </td>
  </tr>

Open in new window

0
 
techExtremeCommented:
Hi, try placing your button markup in a div like this:

<div style="display:block;float:right;">
...your button html markup here...
</div>

0
 
brgdotnetAuthor Commented:
All good answers. The use of Div is what I needed. Thank you!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now