Okay, I have text next to an image, and automatically the text alligns to the bottom of the image, how can I make it align to the middle?
| SitePoint Sponsor |




Okay, I have text next to an image, and automatically the text alligns to the bottom of the image, how can I make it align to the middle?




The CSS
The HTMLHTML Code:div.header { width: 660px; height: 30px; text-align: right; border-top: 5px solid #B00000; border-bottom: 1px solid #8A8A8A; background-color: #FFFFFF; padding: 15px 0px 15px 0px; }
HTML Code:<div class="header"><a href="index.htm" class="navi">HOME</a><a href="index.htm" class="navi">PORTFOLIO</a><a href="index.htm" class="navi">ARTICLES</a><a href="index.htm" class="navi">TUTORIALS</a><a href="index.htm" class="navi">FORUM</a><a href="index.htm" class="navir">CONTACT</a><img src="http://www.wv-online.nl/shockedstyle/img/logo.gif"></div>


Hi,
Try this:
Only works as long as the elements are on one single line.Code:div.header a, div.header img {vertical-align:middle}
Paul
Originally Posted by Yuneek
Just insert a table with 2 colomns, put the image in the lefthand side and the text on the righthandside of the divide. Choose 0 borders and no colour if you do not want the borders of the table showing.
This is if using just HTML or Frontpage, or dreamweaver etc.




Lol, no. I'm hand coding a W3C Strict website.Originally Posted by Sonjaj


I've given the answer above! Theres no need for nasty tables lol![]()




And your answer worked, thanks a lot mate.
Now if you would answer this: http://www.sitepoint.com/forums/showthread.php?t=189549 everything would be peachy.
Bookmarks