question

MalamMalam-4042 avatar image
0 Votes"
MalamMalam-4042 asked LanHuang-MSFT answered

Align an Input Button next to a Canvas

I have a Label, a Canvas and an Input Button next to each other.
The Label and the Canvas are aligned fine but the Input Button is not.
How do I make them to align nicely?

 Access Denied
 You don't have permission to access "http://docs.microsoft.com/answers/questions/ask.html" on this server.
 Reference #18.b533ca17.1646056712.761be46

178468-canvas.png



dotnet-aspnet-webforms
canvas.png (5.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LanHuang-MSFT avatar image
0 Votes"
LanHuang-MSFT answered

Hi @MalamMalam-4042,
I think you can set the button's margin-top property to move the button up a certain distance.For details, see the demo below.
This problem is due to the limitation of code format, you can put the code in notepad or screenshot.

Access Denied
You don't have permission to access "http://docs.microsoft.com/answers/questions/ask.html" on this server.
Reference #18.b533ca17.1646056712.761be46

 <form id="form1" runat="server">
         <label id="label1">text</label>
         <canvas id="canvas"></canvas>
           
          <div id="viewer">
              <button id="button1">button1</button>              
             </div>
     </form>
 <style>
 #label1{
     float:left;
 }
 #canvas{
     width:200px;
     height:200px;
     float:left;
     background-color:blue;
 }
    
 #button1{      
       float:left;
       margin-top:178.5px;
 }
 </style>

178725-1.jpg
Best regards,
Lan Huang


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



1.jpg (99.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.