We help IT Professionals succeed at work.
Get Started

Vertical Align Anchor Text With Anchor Image using CSS

maddhacker24
maddhacker24 asked
on
710 Views
Last Modified: 2012-05-09
I can not for the life of me figure out this simple little task. I need the RSS Text to vertically align with the rss icon. I have tried playing with margins, padding, line-height, vertical-align, etc....none seem to work for me.  Im testing in IE 8 and Chrome.

I know its something probably so simple but I have racked my brain for the last hour to no end.  I attached a small snippet of what I have.

Thanks!
<html>
<head>
	<title>CSS Test</title>
	<style type="text/css">
	#Box {
		width: 75px;
		height: 28px;
		margin: 0px 0px 0px 0px;
		padding: 0px 0px 0px 0px;
		background: url("http://216.66.56.37/images/PopcornTrail_BG.gif");
	}
	
	#Box a {
		vertical-align: middle;
		color: #ff9933;
		font-family: Arial, Helvetica, sans-serif;
		font-size: 14px;
		font-weight: bold;
		text-decoration: none;
	}
	</style>
</head>
<body>
	<div id="Box">
		<a href="#"><img src="http://216.66.56.37/images/icons/rss.gif" width=28" height="28">RSS</a>
	</div>
</body>
</html>

Open in new window

Comment
Watch Question
Top Expert 2010
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE