Click to See Complete Forum and Search --> : how to wrap text in paragraph


learner2006
08-16-2007, 06:03 PM
I want to wrap some text inside paragraph,
here is what I have, I use div tag and it woks, but it won't validate,
I am just looking to see what other option I have, to have the same result, be able to ,align it right or left, have background color ,have border, width ,etc...

<p>this some text, and more text,...,this some text, and more text,...,this some text, and more text,...,this some text, and more text,...,this some text, and more text,...,this some text, and more text,...,this some text, and more text,...,

< div style="width: 220px; border: 1px #333300; float: right; padding: 7px; background: #FDFDF0; margin: 7px">
this some text that is wrapped, this some text that is wrapped, this some text that is wrapped, this some text that is wrapped,
</div>
this some text, and more text,...,</p>


appreciate your help

David Harrison
08-16-2007, 06:46 PM
Sorry, but you can't put a block level element inside a paragraph. Div is a block level element.

If the text that you want to offset is actually part of a different paragraph though, why not simply use a separate paragraph for it? If you don't want any of the margins or padding that comes with it, then CSS can remove those for you.

learner2006
08-16-2007, 07:02 PM
Thanks for reply,
well, I did use separate paragraph but this does have its own issue ,
the thing is my text as a paragraph comes in between another paragarph,
as you see in my example the text inside the DIV tag is mine that I want to insert in to the paragraph, so it won't work, because where this is inserted the <p> is not closed and anther <p> has been added, I don't have control over the first paragraph.

Centauri
08-16-2007, 08:15 PM
Instead of a div, use a span.

ray326
08-16-2007, 11:19 PM
What is the meaning of the text you want to insert in relation to the paragraph?