By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,093 Members | 1,325 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,093 IT Pros & Developers. It's quick & easy.

How to put blank spaces between buttons?

P: 55
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?

Expand|Select|Wrap|Line Numbers
  1. <input type="button" id=""  value=" " onclick="">
  2. <input type="button" id=""  value=" " onclick="">
Ta.

Divina
Aug 23 '07 #1
Share this Question
Share on Google+
9 Replies


drhowarddrfine
Expert 5K+
P: 7,435
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:
Expand|Select|Wrap|Line Numbers
  1. <input type="button" id=""  value=" " onclick="" style="margin-right: 30px">
Aug 23 '07 #2

P: 55
...and how about if I only have one button and I wanted that Tabbed in?

Ta.
Aug 23 '07 #3

P: 2
Expand|Select|Wrap|Line Numbers
  1. style="margin-left:30px;"
Aug 24 '07 #4

P: 22
you can use margin

see the below code:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Page Title</title>
  5. </head>
  6. <body>
  7. <input type="button" id="" value="reset" onclick=""  style="margin-right: 30px">
  8. <input type="button" id="" value=" submit" onclick="" "> 
  9. </body>
  10. </html>
Apr 4 '19 #5

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

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Page Title</title>
  5. </head>
  6. <body>
  7. <input type="button" id="" value="reset" onclick="">&nbsp;
  8. <input type="button" id="" value=" submit" onclick="" ">
  9. </body>
  10. </html>
Below code for margin property
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Page Title</title>
  5. </head>
  6. <body>
  7. <input type="button" id="" value="reset" onclick="" >
  8. <input type="button" id="" value=" submit" onclick="" style="margin-left:20px;">
  9. </body>
  10. </html>
  11.  
Jan 20 '20 #6

gits
Expert Mod 5K+
P: 5,389
using the 'nonbreakingspace' = &nbsp is the worst solution to use. Layout should always be done by css - thats what it is for.
Jan 20 '20 #7

P: 21
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.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.     <meta charset="UTF-8">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8.     <title>Title</title>
  9.     <style>
  10.         .btnSubmit {
  11.             margin: 25px;
  12.         }
  13.  
  14.         .btnCancel {
  15.             margin: 25px;
  16.         }
  17.     </style>
  18. </head>
  19. <body>
  20.     <input class="btnSubmit" type="button" name="btnSubmit" value="Submit" />
  21.     <input class="btnCancel" type="button" name="btnCancel" value="Cancel" />
  22. </body>
  23. </html>
Jan 29 '20 #8

Redmillion
P: 1
If you want to blank space so you should to use this &nbsp;
Jan 29 '20 #9

gits
Expert Mod 5K+
P: 5,389
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.
Jan 29 '20 #10

Post your reply

Sign in to post your reply or Sign up for a free account.