Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
149
rated 0 times [  152] [ 3]  / answers: 1 / hits: 23567  / 11 Years ago, tue, october 15, 2013, 12:00:00

I have this javascript for adding white space between two buttons, I just created and inserted in a div:



document.getElementById(divID).appendChild(buttonONE);

document.getElementById(divID).innerHTML + = ;

document.getElementById(divID).appendChild(buttonTWO);


There is a space between the two buttons, but is always just one space, like if you had pressed the space-bar only once.



How can I increase these spaces to more than one?



Thanks


More From » html

 Answers
16

  1. All white space in HTML, including line breaks, gets reduced to just one space. That's the rule.


  2. Don't use spaces. They are not exact. Use an element and give it a width, padding, or margin in CSS.


  3. If you MUST use spaces, use  . This is a non-breaking space, and all of them get printed. But really, don't use it.



[#74974] Monday, October 14, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
averyc

Total Points: 102
Total Questions: 113
Total Answers: 89

Location: Taiwan
Member since Mon, Sep 6, 2021
3 Years ago
;