0

I have an iFrame in a php, i want to show it as centered horizontal atleast, Here is my code. How can i edit it to make it show center horizontal in browser

<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
</head>
<body>

<div>
<iframe src="https://<??>" width="850" target="_parent" height="850" scrolling="no" style="overflow:hidden; border:none;" style = "display:block;"></iframe>
</div>

</body>
</html>
Pascamel
  • 953
  • 6
  • 18
  • 28
Muhammad Umar
  • 11,391
  • 21
  • 91
  • 193

2 Answers2

1
  1. You have two separate style tags. Be sure to merge them into one.
  2. Try adding margin: 0 auto; to your style tag.
Wayne Whitty
  • 19,513
  • 7
  • 44
  • 66
0

You need to put the iframe in a div then use css to center in the div like so:

<div class="myframe">
<iframe src="http://google.com" width="850" target="_parent"  height="850" scrolling="no"         border:none;></iframe>
</div>

<style type="text/css">
.myframe
{
margin: 0px auto;
width: 850px;
}
</style>