HTML的<marquee>标签怎么用?
yanghs · · 908 次点击 · · 开始浏览在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>
效果图:
相关推荐:
有疑问加站长微信联系(非本文作者)
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
关注微信- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码` - 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传
收入到我管理的专栏 新建专栏
在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>
效果图:
相关推荐: