Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Align text to the right of an image && text doesn't wrap around the image

Tags:

css

image

Should look like this:

[img] text text
      text text

How is this accomplished?

Seems straight forward, but I'm struggling.

like image 848
JoJ Avatar asked Aug 10 '11 00:08

JoJ


People also ask

How do I put text on the right side of a picture?

in order to have text on the left or right of the image you can style your img as style="float:left"; or style="float:right"; If the text is too close to the image you can play with padding: 10px; or less.

How do I align text to the right side of an image in HTML?

To align the image to the right use attribute value as “right”. Example: HTML.

How do I align text to the right side?

Select the text that you want to align. On the Home tab, in the Paragraph group, click Align Left or Align Right .

How do I align text side by side to a picture?

Put the image's maximum width to 100% with the max-width property. Set the flex-basis property of the "image" class to specify the initial main size of your image. Choose the font size of your text with the help of the font-size property. Use the padding-left property to set the padding space on the text's left side.


1 Answers

You can use display:inline-block;

img{
    display:inline-block;
    width:75px;
    height:100px;
    border:1px solid red;
    vertical-align:top;
    margin-right:10px;
}

div{
    display:inline-block;
    width:200px;
}

Example: http://jsfiddle.net/jasongennaro/SK9ad/

To make inline-block; work with IE7, add the following to each rule:

zoom: 1;
*display:inline;
like image 157
Jason Gennaro Avatar answered Sep 23 '22 02:09

Jason Gennaro