469,270 Members | 1,086 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

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?

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
9 91502
drhowarddrfine
7,435 Expert 4TB
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
...and how about if I only have one button and I wanted that Tabbed in?

Ta.
Aug 23 '07 #3
Expand|Select|Wrap|Line Numbers
  1. style="margin-left:30px;"
Aug 24 '07 #4
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
AjayGohil
84 64KB
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
5,390 Expert Mod 4TB
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
Ishan Shah
47 32bit
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
If you want to blank space so you should to use this &nbsp;
Jan 29 '20 #9
gits
5,390 Expert Mod 4TB
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.

Similar topics

2 posts views Thread by Nimmy | last post: by
3 posts views Thread by ShaeMills via AccessMonster.com | last post: by
1 post views Thread by abhilash12 | last post: by
KeredDrahcir
1 post views Thread by KeredDrahcir | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.