Text arrangement using CSS

I am trying to simply arrange some text on the same line seperated by some spaces, but not getting anywhere. Can someone help out please ?

<HTML>
<HEAD>
 <TITLE></TITLE>
 <link href="styles.css" type="text/css" rel="stylesheet">
</HEAD>

<BODY BGCOLOR=#FFFFFF>

<div class="container">
      <div class="float1">First Name:</div>
      <div class="float2">Last Name:</div>
</div>

</BODY>
</HTML>
nmretdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BogoJokerCommented:
Why do you need to give First Name and last name different <div>s?  Can you just do:
<div class="container">
     First Name:&nbsp&nbsp&nbsp&nbsp;Last Name:
</div>

Or:
<div class="container">
<table>
  <tr><td width=100px>First Name:</td><td>Last Name:</td></tr>
</table>
</div>

If you want it done with just CSS then there are a bunch of ways, each a little more complicated.
Joe P
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jagadeesh_motamarriCommented:
Perhaps using CSS...u could do this..

<div class="container">
     <div class="float1" style="float:left">First Name:&nbsp;&nbsp;&nbsp;</div>
     <div class="float2">Last Name:</div>
</div>


.................................................................................................
&nbsp;   -> insert empty space between the FirstName and LastName

more &nbsp;'s ...more spaces
..................................................................................................
style="float:left" -> is important here to get the div tags in the same line...

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.

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.