在HTML中,<marquee>标签用于在网页中创建滚动文本或图像;可以从水平向左或向右或向右或向左滚动,也可以从上到下或从下到上滚动。
原文地址:HTML的标签怎么用?
marquee元素是成对出现的,下面是<marquee>标签的一些属性列表:
示例1:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Marquee标签</title>
<style>
.main {
text-align:center;
}
.marq {
padding-top:30px;
padding-bottom:30px;
}
.hello {
font-size:36px;
font-weight:bold;
color:white;
padding-bottom:10px;
}
</style>
</head>
<body>
<div class = "main">
<marquee class="marq" bgcolor = "pink" direction = "left" loop="" >
<div class="hello">Hello World!</div>
</marquee>
</div>
</body>
</html>
效果图:
示例2:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Marquee标签</title>
<style>
.main {
text-align:center;
}
.marq {
padding-top:30px;
padding-bottom:30px;
}
.hello {
font-size:36px;
font-weight:bold;
color:white;
padding-bottom:10px;
}
</style>
</head>
<body>
<div class = "main">
<marquee class="marq" bgcolor = "pink" direction = "up" loop="" >
<div class="hello">Hello World!</div>
</marquee>
</div>
</body>
</html>
效果图:
示例3:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Marquee标签</title>
<style>
.main {
text-align:center;
}
.marq {
height: 100px;
padding:20px;
}
.hello {
font-size:36px;
font-weight:bold;
color:white;
}
</style>
</head>
<body>
<div class = "main">
<marquee class="marq" bgcolor = "pink" direction = "down" loop="" >
<div class="hello">Hello World!</div>
</marquee>
</div>
</body>
</html>
效果图:
相关推荐:
有疑问加站长微信联系(非本文作者)