通过JS代码控制iframe居左或者居右显示,下面的代码控制iframe居右显示,如果希望居左显示,只需要将right改成left即可
<!DOCTYPE html> <html> <body> <p>This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. <iframe id="myframe" src="/default.asp"> <p>Your browser does not support iframes.</p> </iframe> This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</p> <script> document.getElementById("myframe").align="right"; </script> </body> </html>