views:

135

answers:

2

Hello, What is proper way to display a gif image into the dialog with text with nice formatting etc.. So far here is my code: Copy code

var $dialog = jQuery('<div></div>').html('<p>Sending your message...</p><img src="../images/AjaxWait.gif"/>')

however by doing this the gif is not aligned nicely to the text, etc What is the best way to format content of the dialog? thanks bogumbiker

A: 

You need to use CSS, what are you looking for as the end result.

Something like this I would float my image left

var $dialog = jQuery('<div></div>').html('<p>Sending your message...</p><img src="../images/AjaxWait.gif" style="float: left; padding: 10px;"/>')
Dustin Laine
I believe the paragraph needs to be floated, not the image.
Timothy Khouri
depends on what you want it to look like. I assume this is an animated gif, so I prefer the gif to spin to the left of the text.
Dustin Laine
Thanks! So the: "stylefloat: left; padding: 10px;"will only style image? Or both <P> and <img> tags?thanks
bogumbiker
It will move the image to the left and put a little space around it so that the image is not right up next to the text.
Dustin Laine
Ok will give it a trythanks
bogumbiker
A: 

Float the paragraph to the left with CSS.

Timothy Khouri