Center text in DIV

How can I center the text in the middle of a DIV,

When I look at the code in dreamweaver it looks good, but on IE, FF the text is in the center but at the top of the DIV, and I want in the middle.

here is my css for the DIV
.thrColFixHdr #search {
	background-image:url(../images/search_background_round.jpg);
	background-repeat:no-repeat;
	background-color:#b5d6b7;
	height:70px;
	width:652px;
	margin-left:auto;
	margin-right:auto;
	margin-top:15px;
	text-align:center;
	vertical-align:middle;
}

Open in new window

LVL 1
EnnioAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MidaniCommented:
instantiate the class in your html and then center it in your html.

is there a problem with centering the class in the html?

Midani
0
MidaniCommented:
Hey I thought of something:

<div class="thrColFixHdr" align="center">
</div>
or
<div class="thrColFixHdr ">
   <div align="center"></div>
</div>

0
WMS52Commented:
As Midani said...what's wrong with...
<div><center>Hello</center></div>

Open in new window

0
lpxtechCommented:
Hi,

playing with some css properties, I found this to work.
<div id="wrapper" style="display: table; height: 500px; width: 500px; #position: relative; overflow: hidden; text-align: center;">
	<div id="myDiv" style=" #position: absolute; #top: 50%;display: table-cell; vertical-align: middle;">
		<div class="innerDiv" style="#position: relative; #top: -50%;">
			<p>This text is centered</p>
		</div>
	</div>
</div>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lpxtechCommented:
You can view an example here.

http://www.lpxtech.com/test.php
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.