0

http://makememodern.com/portfolio/

You will see that I have embedded a website onto the page and that it is aligned to the right side of the page. I would like it to be centered.

<div style="text-align:center">
<iframe style="-webkit-transform: scale(0.7);" src="http://www.stokeswilliams.com" width="100%" height="700px"></iframe>
</div>
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Thomas T.
  • 15
  • 1
  • 8
  • 1
    possible duplicate of [How to align a
    to the middle of the page](http://stackoverflow.com/questions/953918/how-to-align-a-div-to-the-middle-of-the-page)
    – JohnnyHK Apr 19 '14 at 15:31
  • Please add meaningful code and a problem description here. Don't just link to the site that needs fixing - otherwise, this question will lose any value to future visitors once the problem is solved. Posting a [Short, Self Contained, Correct Example (SSCCE)](http://www.sscce.org/) that demonstrates your problem would help you get better answers. For more info, see [Something on my web site doesn't work. Can I just paste a link to it?](http://meta.stackexchange.com/questions/125997/) Thanks! – j08691 Apr 19 '14 at 15:32

1 Answers1

0

You are setting the width of the iframe as 1100px. The div that's wrapping it has a dynamic width.

To solve it, you can set the width of the iframe to match the width of its parent container, by doing this:

iframe {
    width: 100%;
}
jackfrankland
  • 2,052
  • 1
  • 13
  • 11
  • I changed the width from 1100px to 100% and the iframe centered on the page which is great, but I was hoping to show the entire width of the embedded page. I can increase the width to 120% but it results in an offset embedded page like before. I have edited my original question to include the code. Thanks for your help. – Thomas T. Apr 19 '14 at 19:10
  • I have decided to change my portfolio page to not include an embedded site... It didn't look very good in my opinion. Thanks for your help! – Thomas T. Apr 20 '14 at 02:43