gpt4 book ai didi

html - HTML、CSS、JS 中的文本旋转

转载 作者:行者123 更新时间:2023-11-28 13:45:25 26 4
gpt4 key购买 nike

如何旋转文本(跨浏览器)?我的代码适用于 FireFox、Opera :(

我也想在 IE 上旋转文本(_旋转度数可以是 15 到 60 度之间的任意度数)

<html>
<head>
<style type="text/css">

#memo
{
width:200px;
word-wrap: break-word;
background-color:yellow;
}
</style>
</head>

<body>
<php
$deg=rand(15,60);
?>

<div id="memo" style="transform:rotate(<?php echo $deg; ?>deg); -moz-transform:rotate(<?php echo $deg; ?>deg);-webkit-transform:rotate(<?php echo $deg; ?>deg);-o-transform:rotate(<?php echo $deg; ?>deg);">Hello</div>
</body>

</html>

最佳答案

对我来说似乎在所有现代浏览器(不是 IE)中都能正常工作。

演示:turi.co/up/rand_rotate

<?php $deg=rand(15,60); ?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Random transform:rotate</title>
<style type="text/css">
#memo {
width:5em; word-wrap:break-word; margin:2em;
font:700 3em/1.2 'myriad pro', sans-serif;
transform:rotate(<?php echo $deg; ?>deg);
-o-transform:rotate(<?php echo $deg; ?>deg);
-moz-transform:rotate(<?php echo $deg; ?>deg);
-webkit-transform:rotate(<?php echo $deg; ?>deg);
}
</style>
</head>
<body>
<div id="memo">Hello</div>
</body>
</html>

关于html - HTML、CSS、JS 中的文本旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5521952/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com