How do I place an image centered in a DIV and text to the right? Overflow problems

Posted by user2218041 on Stack Overflow See other posts from Stack Overflow or by user2218041
Published on 2013-06-28T15:11:53Z Indexed on 2013/06/28 16:21 UTC
Read the original article Hit count: 178

Filed under:
|

I have a div container where I want to put in a centered image and a small description to the right. The specifications are:

  1. The image should have a bottom margin of 35px.
  2. The image should always show fully on the screen, so it resizes when the screen does. It should have the biggest size possible, but never be cropped and never use scrollbars.
  3. The image should be centered with respect to the container, with the text showing on the right margin.
  4. The text should be left-aligned horizontally, center-aligned vertically and have a 30px separation from the image.

I've tried using a table in the container and using divs, but I can't find a clean solution. I can show you the non-working code I've tried on request.

© Stack Overflow or respective owner

Related posts about css

Related posts about div