How to put blank spaces between buttons?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • divina11
    New Member
    • Aug 2007
    • 55

    How to put blank spaces between buttons?

    So, if you have two buttons side by side how do you create space between them? I've tried the 'SPACER' tag, however this did not work?

    Code:
    <input type="button" id=""  value=" " onclick="">
    <input type="button" id=""  value=" " onclick="">
    Ta.

    Divina
    Last edited by gits; Jan 20 '20, 08:22 AM.
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Originally posted by divina11
    I've tried the 'SPACER' tag, however this did not work?[/HTML]
    There is no such thing as a 'spacer' tag.

    Always use margin or padding for spacing. In CSS:
    Code:
    <input type="button" id=""  value=" " onclick="" [B]style="margin-right: 30px[/B]">
    Last edited by gits; Jan 20 '20, 08:24 AM.

    Comment

    • divina11
      New Member
      • Aug 2007
      • 55

      #3
      ...and how about if I only have one button and I wanted that Tabbed in?

      Ta.

      Comment

      • pimperiale
        New Member
        • Aug 2007
        • 2

        #4
        Code:
        style="margin-left:30px;"
        Last edited by gits; Jan 20 '20, 08:24 AM.

        Comment

        • gosai jahnvi
          New Member
          • Apr 2019
          • 22

          #5
          you can use margin

          see the below code:
          Code:
          <!DOCTYPE html>
          <html>
          <head>
          <title>Page Title</title>
          </head>
          <body>
          <input type="button" id="" value="reset" onclick=""  style="margin-right: 30px">
          <input type="button" id="" value=" submit" onclick="" "> 
          </body>
          </html>
          Last edited by gits; Jan 20 '20, 08:24 AM. Reason: added code tags

          Comment

          • AjayGohil
            New Member
            • Apr 2019
            • 83

            #6
            Hello,You can use &nbps; in HTML and also you can use margin property of CSS in style tag.
            Below code for &nbps;

            Code:
            <!DOCTYPE html>
            <html>
            <head>
            <title>Page Title</title>
            </head>
            <body>
            <input type="button" id="" value="reset" onclick="">&nbsp;
            <input type="button" id="" value=" submit" onclick="" ">
            </body>
            </html>
            Below code for margin property
            Code:
            <!DOCTYPE html>
            <html>
            <head>
            <title>Page Title</title>
            </head>
            <body>
            <input type="button" id="" value="reset" onclick="" >
            <input type="button" id="" value=" submit" onclick="" style="margin-left:20px;">
            </body>
            </html>

            Comment

            • gits
              Recognized Expert Moderator Expert
              • May 2007
              • 5388

              #7
              using the 'nonbreakingspa ce' = &nbsp is the worst solution to use. Layout should always be done by css - thats what it is for.

              Comment

              • Ishan Shah
                New Member
                • Jan 2020
                • 47

                #8
                Hello! You can use margin to give the space between to buttons and you can also use the margin-left to the button for the same.

                Code:
                <!DOCTYPE html>
                <html lang="en">
                
                <head>
                    <meta charset="UTF-8">
                    <meta name="viewport" content="width=device-width, initial-scale=1.0">
                    <meta http-equiv="X-UA-Compatible" content="ie=edge">
                    <title>Title</title>
                    <style>
                        .btnSubmit {
                            margin: 25px;
                        }
                
                        .btnCancel {
                            margin: 25px;
                        }
                    </style>
                </head>
                <body>
                    <input class="btnSubmit" type="button" name="btnSubmit" value="Submit" />
                    <input class="btnCancel" type="button" name="btnCancel" value="Cancel" />
                </body>
                </html>

                Comment

                • Redmillion
                  New Member
                  • Jan 2020
                  • 1

                  #9
                  If you want to blank space so you should to use this &nbsp;

                  Comment

                  • gits
                    Recognized Expert Moderator Expert
                    • May 2007
                    • 5388

                    #10
                    If you want to blank space so you should to use this &nbsp;
                    in post #7 i did touch on explaining why that is a very bad, if not the worst, solution.

                    Comment

                    Working...