admin管理员组文章数量:1392076
<!doctype html>
<html>
<head>
<title>Main</title>
<style>
#titlePic {
text-align: center;
}
#3dCanvas {
text-align: center;
}
#difficulties {
text-align: center;
}
</style>
</head>
<body>
<div id='titlePic'>
<h1>
<img src="../IndividualProject/images/SHIFT_PROMO.png" alt="SHIFT_PROMO" width="512" height="250"/>
</h1>
</div>
<div id='3dCanvas'>
<script src='./Scripts/three.min.js'></script>
<script src='./Scripts/threex.text.js'></script>
<script src="./Scripts/droid_serif_bold.typeface.js"></script>
<script src='./Scripts/3dText.js'></script>
</div>
<div id='difficulties'>
<h2>
<a href="index.html"><img src="../IndividualProject/images/Marathon.png" alt="Marathon" width="321" height="54" /></a>
<br><br>
<a href="index.html"><img src="../IndividualProject/images/Easy.png" alt="Easy" width="164" height="48" /></a>
<br><br>
<a href="index.html"><img src="../IndividualProject/images/Medium.png" alt="Medium" width="225" height="48" /></a>
<br><br>
<a href="index.html"><img src="../IndividualProject/images/Hard.png" alt="Hard" width="162" height="48" /></a>
<br><br>
</h2>
</div>
</body>
</html>
Im trying to move this 3D animated text to the center of the HTML page but nothing seems to work, any help?
The JavaScript files are located in 3dCanvas, text align seems to do nothing
here is a codepen
<!doctype html>
<html>
<head>
<title>Main</title>
<style>
#titlePic {
text-align: center;
}
#3dCanvas {
text-align: center;
}
#difficulties {
text-align: center;
}
</style>
</head>
<body>
<div id='titlePic'>
<h1>
<img src="../IndividualProject/images/SHIFT_PROMO.png" alt="SHIFT_PROMO" width="512" height="250"/>
</h1>
</div>
<div id='3dCanvas'>
<script src='./Scripts/three.min.js'></script>
<script src='./Scripts/threex.text.js'></script>
<script src="./Scripts/droid_serif_bold.typeface.js"></script>
<script src='./Scripts/3dText.js'></script>
</div>
<div id='difficulties'>
<h2>
<a href="index.html"><img src="../IndividualProject/images/Marathon.png" alt="Marathon" width="321" height="54" /></a>
<br><br>
<a href="index.html"><img src="../IndividualProject/images/Easy.png" alt="Easy" width="164" height="48" /></a>
<br><br>
<a href="index.html"><img src="../IndividualProject/images/Medium.png" alt="Medium" width="225" height="48" /></a>
<br><br>
<a href="index.html"><img src="../IndividualProject/images/Hard.png" alt="Hard" width="162" height="48" /></a>
<br><br>
</h2>
</div>
</body>
</html>
Im trying to move this 3D animated text to the center of the HTML page but nothing seems to work, any help?
The JavaScript files are located in 3dCanvas, text align seems to do nothing
http://codepen.io/anon/pen/RNVwop here is a codepen
Share Improve this question edited Jan 17, 2015 at 21:04 Gan 1641 gold badge4 silver badges13 bronze badges asked Jan 17, 2015 at 19:52 TeaAnyOneTeaAnyOne 4973 gold badges9 silver badges16 bronze badges 2- can you recreate this in a fiddle or something? – jmore009 Commented Jan 17, 2015 at 19:57
- codepen.io/anon/pen/RNVwop here is a codepen – TeaAnyOne Commented Jan 17, 2015 at 20:11
1 Answer
Reset to default 3You need just
body { text-align: center; }
or
canvas { margin: 0 auto; display: block;}
I didn't figured out who does create canvas: it seems it will be better to edit that script to make a wrapper around canvas, so it will be able to write better css
本文标签: Center align a JavaScript script on a HTML pageStack Overflow
版权声明:本文标题:Center align a JavaScript script on a HTML page - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744780863a2624704.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论