Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

CSS 3 items vertically aligned {left, center, right} floating

CSS 3 items vertically aligned {left, center, right} floating

Problem

here is the working fiddle:

http://jsfiddle.net/2bNsC/67/

I need to place the 3 items (text and 2 images), vertically aligned (it's ok) but the right picture should be anchored on right, and the text centered

Good CSS

Problem courtesy of: user1125394

Solution

SPAN tags are as wide as their CONTENTS, so setting something to be centered doesn't make any sense.

Use a DIV (a block element) instead. Block elements are as wide as their CONTAINERS.

Lorem

One good trick, add a background-color or border to the element do you can see exactly where it is in the layout. This is very hand in debugging these types of issues.

Lorem
Solution courtesy of: Diodeus

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

CSS 3 items vertically aligned {left, center, right} floating

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×