Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJohn Levy
1,451 PointsHow to place a image on the same line as text
I am trying to place a image on the same line as the text. I want to place the image on the right. I have tried float: right; but that does not work. I have attached the code below. How can I make the image line up on the right hand side rather than falling below the text? http://codepen.io/Johned22/pen/NbpPJJ
Thanks in advance
1 Answer
Iain Simmons
Treehouse Moderator 32,305 PointsThis should do it:
.image {
vertical-align: middle;
}
That will be next to the text. You can still use float: right
if you need.