views:

18

answers:

1

Hello! My problem is:

<div style="width: 400px" contenteditable="true">
abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc 
(...) 
abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc 
<img src="pic.jpg" style="display: block" />
abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc 
(...) 
abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc 
</div>

When user edit text before the image and new line is created (because text wrap) image goes lower. Can I set that the image doesn't change the location and the text (and other content) will still correctly flow the image? I need it only in chrome. If it is not possible can you tell me the best way how to do it using java-script? Thx for help!!

Regards, Umpc

A: 

Sounds to me like you would want this, with the padding optional, but usually desirable.

<img src="pic.jpg" style="float:left; padding:0 10px 10px 0;" />
jarrett
Thx for replay! Unfortunately I want something another. When I use padding property I will have only additional space surrounding image. I want to force image to keep absolute location on the page when user will write some more text before image. I can set absolute position for image, but then I will loose wrapping text around the image. Is there any solution for this?
Upcy
The position of your image needs to be inline or the text won't know how to wrap around it. However, with an inline element you can't have the absolute positioning you want. So what you want might be some javascript to rewrite the html as they are typing it. Or you could reconsider your layout. You can't accomplish what you want with the way you have it setup now.
jarrett