- Alternatives of the HTML tag
- How to use marquee tag in CSS?
The tag is a non-standard HTML tag which was used to create a scrolling text or an image. It was used to make the text or image scroll horizontally across or vertically down the web page. Because of its usability problems it was often compared with Netscape’s blink element.
The element is a deprecated HTML tag. If you use it, your pages or apps may be broken.
Alternatives of the HTML tag
html tag comes in pairs. The content is written between the opening (
<marquee>) and closing (
How to use marquee tag in html:
Use direction attribute of this html element to change the direction of the text/image. See another example where the text scrolls from up to down.
How to use marquee tag in html for a scrolling text:
Now let’s see an example of using element for setting a scrolling image:
How to use marquee tag in html for scrolling image:
Use CSS width and background-color properties to style this element.
How to use marquee tag in html of creating a scrolling text:
The following attributes can be used to adjust the appearance of the element.
|Defines the scrolling type.|
|Is used to give a background color.|
|Sets the direction for the scrolling content.|
|Defines the marquee’s height.|
|hspace||pixels||Defines horizontal space around the marquee.|
|loop||number||Defines how many times the content will scroll. If we don’t define this, the content will scroll forever.|
|scrollamount||number||Defines the scrolling amount at each interval in pixels. Default value is 6.|
|scrolldelay||seconds||Defines how long delay will be between each jump. The default value is 85 and smaller amounts than 60 will be ignored.|
|truespeed||seconds||Is used to delay the scroll lesser than 60.|
|vspace||pixels||Defines vertical space around the marquee.|
|Defines the marquee’s width.|
The html tag also supports the Global attributes and the Event Attributes.
How to use marquee tag in CSS?
Common properties to alter the visual weight/emphasis/size of text in tag:
- CSS font-style property sets the style of the font. normal | italic | oblique | initial | inherit.
- CSS font-family property specifies a prioritized list of one or more font family names and/or generic family names for the selected element.
- CSS font-size property sets the size of the font.
- CSS font-weight property defines whether the font should be bold or thick.
- CSS text-transform property controls text case and capitalization.
- CSS text-decoration property specifies the decoration added to text, and is a shorthand property for text-decoration-line, text-decoration-color, text-decoration-style.
How to use marquee tag in CSS Coloring text:
- CSS color property describes the color of the text content and text decorations.
- CSS background-color property sets the background color of an element.
How to use marquee tag in CSS Text layout styles:
- CSS text-indent property specifies the indentation of the first line in a text block.
- CSS text-overflow property specifies how overflowed content that is not displayed should be signalled to the user.
- CSS white-space property specifies how white-space inside an element is handled.
- CSS word-break property specifies where the lines should be broken.
Other properties worth looking at how to use marquee tag in CSS:
- CSS text-shadow property adds shadow to text.
- CSS text-align-last property sets the alignment of the last line of the text.
- CSS line-height property specifies the height of a line.
- CSS letter-spacing property defines the spaces between letters/characters in a text.
- CSS word-spacing property sets the spacing between words.