Marquee : add background color in HTML
To add background color of <marquee> element, the bgcolor attribute is used.
Example : set background color to marquee element. #
<marquee bgcolor="red">Hello world</marquee>
Try it Yourself »
Set background color to marquee element using CSS. #
We can also use the css properties to add background color, border, padding, margin etc. to the marquee element.
Add style to marquee element using css. #
<marquee>Hello world</marquee>
<style>
marquee {
background-color: blue;
color:#fff;
padding:5px 15px;
border:5px solid gold;
}
</style>
Try it Yourself »
We can change the marquee speed using the scrollamount attribute.
<marquee scrollamount="30">Hello world</marquee>
save
listen
AI Answer
Marquee : add background color in HTML
2
To add background color of <marquee> element, the bgcolor attribute is used. Example…
asked
Apu
2 answers
2915
To add background color of <marquee> element, the bgcolor attribute is used. Example…
Answer Link
answered
Apu
This is a scrolling text.
</marquee>
1.direction: Sets the scrolling direction of the text. Possible values: left, right, up, down.
2.behavior : Specifies the scrolling behavior of the text. Possible values: scroll, slide, alternate.
3.scrollamount : Sets the speed of the scrolling text in pixels per frame (default is 6).
4.width : Sets the width of the scrolling text area.
5.bgcolor : Sets the background color of the scrolling text area.
https://www.3schools.in/p/embed.html?q=CjxtYXJxdWVlIAogICAgYmVoYXZpb3I9ImFsdGVybmF0ZSIKICAgIGRpcmVjdGlvbj0icmlnaHQiCiAgICBzY3JvbGxhbW91bnQ9IjEwIiAKICAgIHNjcm9sbGRlbGF5PSIxMDAiIAogICAgd2lkdGg9IjMwMCIgCiAgICBoZWlnaHQ9IjUwIiAKICAgIGJnY29sb3I9IiNGRjAiIAogICAgbG9vcD0iaW5maW5pdGUiPgoKIE15IFNjcm9sbGluZyBUZXh0CiAgCjwvbWFycXVlZT4=
behavior - "scroll", "slide", and "alternate"
direction - "left", "right", "up", and "down"