HTML5 Center

I have a page with a panel within a panel. I want the inside iframe to be a specific width but to be center aligned on the page. I have tried numerous things, but below is my latest attempt. However, the panel displays flush left on the screen.

<div style="text-align:center;width:100%;">
<asp:Panel ID="panIframe" style="position: relative;width:835px; height:542px;" runat="server">
<iframe id="SCO" name="" style="width: 100%; height: 100%;"></iframe>
</asp:Panel>
</div>

Open in new window


Truth of the matter is, the below WORKS! But gives me squiggle messages in VS2012 that <center> is not supported in HTML5.
<center>
<asp:Panel ID="panIframe" style="width:835px; height:542px;" runat="server">
<iframe id="SCO" name="" style="width: 100%; height: 100%;"></iframe>
</asp:Panel>
</center>

Open in new window


How do I get the panel to center on the width of the page and be supported in HTML5?

thanks!
LVL 2
Starr DuskkASP.NET VB.NET DeveloperAsked:
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.

GaryCommented:
<center> is deprecated so shouldn't be used
On your panel add the css
margin:0 auto;
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
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
Well, of course! Because margin:0 auto;  is so clearly indicating that it is going to center it! LOL

Guess that's why I need the experts!

thanks!
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
HTML

From novice to tech pro — start learning today.