tags:

views:

45

answers:

1

I was wondering how can align my text so it will display the way I want it to. Can someone help me display the text like it is in example 2 using CSS?

Here is what my text is doing.

Name: At vero eos et 
accusamus et iusto odio dignissimos d

Here is what I want it do.

Name: At vero eos et 
      accusamus et iusto odio dignissimos d

HTML markup.

<div><p><span>Name:</span> At vero eos et 
      accusamus et iusto odio dignissimos d</p></div>
+1  A: 
<style>
div{
  font-family:"Courier New", Courier, monospace;
  margin-left: 65px;
}
span{
  margin-left: -65px;
} 
</style>

Hopefully you can put a <br /> at the end of each linebreak. If you have PHP, you can use nl2br()

You can see the results and code @ http://jsfiddle.net/Sghym/

ina
(fixed formatting and added a jsfiddle preview ;))
ina