views:

46

answers:

2

I want to create an element using DIV & CSS like below:

Create By: <avatar image 16x16> Prashant

Can anyone tell me what will be the CSS and DIV code for above type of layout. I don't want to use tables for this, DIV and CSS only.

In Digg listing you'll find the same kind of display, I tried but not able to make the "username" central align in respect of the avatar image. Please help!!

+4  A: 

<div>Created by: <img src="/images/avatars/prashant.png" alt="" /> Prashant</div>

and

img {
  vertical-align: middle;
}

should do the job.

David Dorward
+1  A: 

vertical-align unfortunately is not handled very consistently by some of the older browsers (pre-2005, but then yet again IE6 is still around), but David's answer is correct from the standards view.

Moki