How to Make a Scrolling Marquee in HTML

A scrolling marquee is moving text added to a website, but HTML is no longer commonly used for this feature and is not recommended. The HTML tag for scrolling marquees has been deleted from the standard HTML library. To accomplish a...
Method 1 of 2:

Using CSS

  1. How to Make a Scrolling Marquee in HTML Picture 1How to Make a Scrolling Marquee in HTML Picture 1
    If you're on a Mac, download the latest version of webkit.[1] Since the CSS module that can create marquees is a part of the webkit specification, you will need to get webkit installed on your machine.
  2. How to Make a Scrolling Marquee in HTML Picture 2How to Make a Scrolling Marquee in HTML Picture 2
    If you're using Windows, download the developer toolset. Unlike on Mac, there is no self-extracting installer for Windows. Windows users will need to install a number of developer tools to use webkit. All necessary tools and specifications can be downloaded here
  3. How to Make a Scrolling Marquee in HTML Picture 3How to Make a Scrolling Marquee in HTML Picture 3
    Add a CSS reference to your HTML file. Open your HTML file and reference your CSS style sheet with the following code:
    .
    1. You can write the CSS reference before creating the CSS file, but you must be sure that the CSS filename matches the one in your code (in this example, 'mystyle.css").
    2. Your HTML and CSS code will remain separate, but run together when you load your HTML file.[2]
  4. How to Make a Scrolling Marquee in HTML Picture 4How to Make a Scrolling Marquee in HTML Picture 4
    Create a 'div' line in your HTML file. Your code might look something like:
    .
    Scrolling text goes here.
    1. div is an HTML element that defines the area on the page that will contain components of the code, in this case your scrolling marquee.
  5. How to Make a Scrolling Marquee in HTML Picture 5How to Make a Scrolling Marquee in HTML Picture 5
    Save your HTML file. 'Go to File > Save As…' Append your HTML file with a .html extension.
  6. How to Make a Scrolling Marquee in HTML Picture 6How to Make a Scrolling Marquee in HTML Picture 6
    Open a separate text document for your CSS style sheet. The shorthand syntax for creating a scrolling marquee with CSS is : '-webkit-marquee: [direction] [increment] [repetition] [style] [speed]'. The webkit tag is necessary because the CSS module that contains the marquee class is part of the Webkit CSS specification.[3]
    1. [direction] will define which direct the marquee scrolls
    2. [increment] measures the pixel distance between each step of the scroll
    3. [repetition] is the number of times the marquee will run
    4. [style] can determine a simple scroll or bouncing text
    5. [speed] is how fast the text moves.
  7. How to Make a Scrolling Marquee in HTML Picture 7How to Make a Scrolling Marquee in HTML Picture 7
    Set values to define the marquee. Set the values in the brackets (remove the brackets, since they are just a placeholder). This will tell your marquee how to act on the page. Your code might look like:
    .-webkit-marquee: auto medium infinite scroll normal;
    1. The 'auto' direction uses the default right-to-left, 'medium' sets a default interval of 6 pixels, 'infinite' sets the marquee to run an unlimited number of times, 'scroll' sets the style to a linear movement, and 'normal' is a default setting for scrolling speed.
  8. How to Make a Scrolling Marquee in HTML Picture 8How to Make a Scrolling Marquee in HTML Picture 8
    Set an 'overflow' on a new line. Add .overflow-x: -webkit-marquee; to a new line in your code. This will make the text scroll continuously along instead of stopping at the edge of the div.[4]
    1. 'overflow-x' specifies what to do with text that exceeds the limit of the space on the x-axis.
    2. '-webkit-marquee' is directing the overflow command towards the marquee module in webkit.
    3. Your full code might look like:
      .-webkit-marquee: auto medium infinite scroll normal;
      overflow-x: -webkit-marquee;
  9. How to Make a Scrolling Marquee in HTML Picture 9How to Make a Scrolling Marquee in HTML Picture 9
    Save your CSS file. 'Go to File > Save As…' Append your CSS file with a .css extension.
  10. How to Make a Scrolling Marquee in HTML Picture 10How to Make a Scrolling Marquee in HTML Picture 10
    Open your HTML file with your browser. Drag and drop the file to your browser to open. Your scrolling marquee will display on the page.
    1. Use a webkit supported browser, like Chrome or Safari to make sure the marquee displays as expected.
Method 2 of 2:

Using HTML

  1. How to Make a Scrolling Marquee in HTML Picture 11How to Make a Scrolling Marquee in HTML Picture 11
    Open your HTML document. Note that using the HTML marquee tag is outdated and strongly discouraged in web design. HTML files can be opened with a simple text editor If you are starting from scratch, open a text file and enter this sample code:
    1. .This is a scrolling marquee
  2. How to Make a Scrolling Marquee in HTML Picture 12How to Make a Scrolling Marquee in HTML Picture 12
    Set a background color. You can change the background of your marquee by specifying a hexadecimal (hex) value, or a RGB (Red Green Blue) value after the "background-color:" part of the code. The default value listed in the sample code, #000080, is navy blue.
    1. For example:
      .
    2. A full list of colors and their values can be found online.[5]
  3. How to Make a Scrolling Marquee in HTML Picture 13How to Make a Scrolling Marquee in HTML Picture 13
    Set a scrolling direction. Change the 'direction' attribute in the code to any of the following: right, left, up or down.
    1. For example:
      .
  4. How to Make a Scrolling Marquee in HTML Picture 14How to Make a Scrolling Marquee in HTML Picture 14
    Specify the number of loops for your marquee. The 'loop' attribute controls how many times the marquee should loop. If you want it to run continuously, leave out this attribute entirely.
    1. An example with the attribute omitted could be:
      .This is a scrolling marquee
  5. How to Make a Scrolling Marquee in HTML Picture 15How to Make a Scrolling Marquee in HTML Picture 15
    Specify the marquee text. The text inside the tag and the tag will be the scrolling text of your marquee. Write whatever you want your marquee to say here.
    1. For example:
      .Watch this text scroll by!
  6. How to Make a Scrolling Marquee in HTML Picture 16How to Make a Scrolling Marquee in HTML Picture 16
    Load your HTML file. Drag and drop the file to your browser to open. Your scrolling marquee will display on the page.
3.8 ★ | 8 Vote