Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1701
  • Last Modified:

Space(10) instead of " " 10 times?

Is there a Space tag in HTML?  I want to make 10 spaces.  Do I really need to code:
          ?
0
LeahTheMack
Asked:
LeahTheMack
  • 4
  • 3
  • 2
  • +1
2 Solutions
 
Ashish PatelCommented:
Yes, unfortunately you will have to, as if you just put white spaces then the browsers will display them as one. No other options buddy.
0
 
SvenTech Lead Web-DevelopmentCommented:
Maybe you can use tables or you can use a <span> and format it via css to the width you want?
0
 
Göran AnderssonCommented:
Why not add the spacing to whatever you have after the spacing? Like:

margin-left: 80px;

or

padding-left: 80px;
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
SvenTech Lead Web-DevelopmentCommented:
This is what I said:
<span style="margin-left: 80px;">Your text here!</span>
 
<span style="width: 80px;">&nbsp;</span>Your text here!

Open in new window

0
 
Göran AnderssonCommented:
No, DarthSonic, you only mentioned the second method, I suggested the first method as an alternative.
0
 
LeahTheMackAuthor Commented:
If I set the span to 80px here, will that goof up other lines on the page (above or below)?
Will that force me to set the span everywhere else to compensate?
0
 
SvenTech Lead Web-DevelopmentCommented:
The span-Tag is an inline element which will only affect the space you defined and the text before and after will not be affected and there will be no break before and after. Try it and see what happens!
0
 
SvenTech Lead Web-DevelopmentCommented:
Here you will find an example and a description of the span-tag:
http://www.w3schools.com/tags/tag_span.asp
0
 
Göran AnderssonCommented:
That depends on how your layout is working. The style applies only to the element where you apply it, but the extra space may affect other elements, just as a lot of &nbsp;s would.

Applying width on an inline tag like a span doesn't have any effect at all, by the way. (Internet Explorer may be applying the width in some settings, but this is a rendering error and should definitely not be used.)
0
 
LeahTheMackAuthor Commented:
Ok, thanks.  Doubling points to split between GreenGhost and DarthSonic
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now