如何更改字幕文本的大小



如何更改字幕文本的大小
请帮忙。我现在使用的招牌代码是:

<marquee behavior="scroll" direction="left" scrollamount="30">Sidebar Test</marquee>

只需添加CSS

marquee {
font-size: xx-large;
}
<marquee behavior="scroll" direction="left" scrollamount="30">Sidebar Test</marquee>

marquee{
font-size:50px;
}
<marquee behavior="scroll" direction="left" scrollamount="30">Sidebar Test</marquee>

经典Html,style="字体大小:50pt">

<marquee style="font-size:50pt;" behavior="scroll" direction="left" scrollamount="30">Sidebar Test</marquee>

字幕的格式如下:https://way2tutorial.com/html/html_marquee_tag.php

针对您关于字体大小的特定问题,请尝试以下操作:

考虑一下字幕在不同浏览器上的工作方式-例如,我注意到Chrome比safari更好地渲染字幕-safari往往有点抖动(水平([我使用的是MacOS Big Sur 11.04]

有很多方法,有两种方法是

  1. style.css中添加marquee{properties}例如-

marquee{
font-size:3em;
width:10em;
height:2em;
color:white;
background-color:black;
}
<marquee attribute_name = "attribute_value"....more attributes>
One or more lines or text message or image
</marquee>

  1. 使用内联CSS。例如-

<marquee style="color:green;font-size:2em;" attribute_name = "attribute_value"....more attributes>
One or more lines or text message or image
</marquee>

您可以使用HTML:style="font-size: 20px;" // you can change the figure as you prefer for the size

完整的<marquee>如下所示:

<marquee height="20" width="100%" bgcolor="white" marquee="" behavior="scroll" direction="left" scrollamount="3" style="font-size: 20px;">Hello World !</marquee>

最新更新