我有一个用 Google swiffy 转换成 html5 的 flash 场景。 一切正常,但我无法让场景(或舞台)与页面右侧对齐。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Swiffy output</title>
<script src="https://www.gstatic.com/swiffy/v4.9/runtime.js"></script>
<script>
swiffyobject = {"tags":[{"bounds":.........HERE IS THE SWIFFY-CODE..........
</script>
<style>html, body {width: 100%; height: 100%}</style>
</head>
<body style="margin: 0; overflow: hidden">
<div id="swiffycontainer" style="width: 800px; height: 310px">
</div>
<script>
var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
swiffyobject);
stage.start();
</script>
</body>
</html>
你能帮忙吗?我认为这对 HTML 专家来说很容易 - 但我无法解决 这个小问题。
最佳答案
我假设脚本是你想要对齐的......如果不是我将它作为一个例子
使用float:right;
你可以让它向右浮动
<div style="float:right;">
<script>
var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
swiffyobject);
stage.start();
</script>
</div>
另一个选项是 text-align:right;
<div style="text-align:right; width:100%;">
<script>
var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
swiffyobject);
stage.start();
</script>
</div>
关于css - 将 swiffy-Stage 对齐到页面右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13821626/