• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

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>
0
nmretd
Asked:
nmretd
2 Solutions
 
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
 
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now