html - 使 <marquee> 成为屏幕宽度

标签 html css

我正在尝试为我的网站顶部设置一个,以便不时放一些东西。但是,它没有到达我的屏幕末端,这看起来很奇怪。 marquee image

HTML

<body>
    <marquee>Super Bowl Sunday!</marquee>`

CSS

marquee {
  background-color: #4CAF50;
}

我该如何扩展它?我尝试使用 alignwidthmargin,但它无法覆盖屏幕并保持居中。任何帮助都会很棒。这可能是因为它被认为是“过时的”?谢谢!

最佳答案

Body PaddingMargin 应该是 0

marquee {
  background-color: #4CAF50;
}
body
{
padding:0;
margin:0;
}
<body>
    <marquee>Super Bowl Sunday!</marquee>
    </body

关于html - 使 <marquee> 成为屏幕宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54499981/

相关文章:

html - CSS Target 一个元素,该元素可能具有许多类之一

javascript - 从 contenteditable div 获取纯文本

html - 表单选择列表 - 最初选择的选项在 IE 中无法正常工作

javascript - 从图像创建渐变

asp.net-mvc - ASP.NET MVC 数据验证 - 突出显示表行与文本框

html - 扩展 View 框以获得更多绘图区域并且 SVG 不会缩小以适合容器

html - 如何让输入字段和按钮填充 Bootstrap 表单中的整行?

html - 如何使行高与字体高度匹配?

Javascript/HTML 错误 “the value of the property “selectReason” 为 null 或未定义,不是函数对象

html - css背景图像仅在边缘