Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7605271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:07:35+00:00 2026-05-31T00:07:35+00:00

A little new to html so if further explanation is necessary or this question

  • 0

A little new to html so if further explanation is necessary or this question just doesn’t make sense please feel free to say so.

I am using div to layout a webform I am designing and using the &nbsp to move text within a div doesnt always produce the result I want as far as the layout of the page.

I started experimenting and by using:

<span style="margin-left:(variable)px"></span>

i am able to move the text exactly where I want it.

My question is this, is this a bad practice? is there a better way to do what I am trying to do, or a more conventional way? Or even something built into html that I just have not discovered yet.

Thank you

* Added Block of code to show what i am trying to accomplish

   Complainant's Address
   <input type="text" size="50" id="complainantAddress"/> 
   <span style="margin-left:3px"></span>
   City
   <input type="text" name="city" maxlength="15" size="15"/>
   <span style="margin-left:16px"></span>
   State
   </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:07:36+00:00Added an answer on May 31, 2026 at 12:07 am

    Using non breakable spaces for layout/positioning is bad practice.
    What you are trying to do with style attributes is better, but inline-style attributes are often considered as bad pratice, too.
    Style attributes are hard to maintain and you duplicate lots of information etc. In addition this styling has the highest specificity and cannot be overwritten by other styles (like user CSS files). They should be used with caution.

    Use CSS attributes margin, padding and text-align for this.

    Sample
    http://jsfiddle.net/UYUA7/

    HTML

    Text<br />
    
    &nbsp;&nbsp;&nbsp;&nbsp;Text <!-- Do NOT use this -->
    
    <div class="center">Center</div>
    <div class="right">Right</div>
    <div class="indent">Indented</div>
    

    CSS

    .center {
        text-align: center;
    }
    
    .right {
        text-align: right;
    }
    
    .indent {
        margin-left: 20px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sorry if this is a really stupid question, I'm a little new to
A little new to EF, so please bear with me if the answer to
hello i am little new to all this but i want to know that:
i am new to RoR and I am a little confused on this topic.
A little new to Javascript coding, so please bear with me. I read through
I'm a little new to asp.net mvc and I have a question (very basic).
Trying to make a spinner that pops up a new little screen the user
Alright so I'm pretty new to this rails stuff so please bear with me...
Well, I know a little HTML, and I'm just interested in playing around with
I wonder whether someone may be able to help please. I'm a little new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.