Align an Input Button next to a Canvas

Malam Malam 266 Reputation points
2022-02-28T13:56:17.36+00:00

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://learn.microsoft.com/answers/questions/ask.html" on this server.  
Reference #18.b533ca17.1646056712.761be46  

178468-canvas.png

Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

Accepted answer
  1. Lan Huang-MSFT 30,186 Reputation points Microsoft External Staff
    2022-03-01T05:27:43.55+00:00

    Hi @Malam Malam ,
    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://learn.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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.