Tuesday, 9 July 2024

Write the marquee program in html

 Here is a simple example of how to create a marquee effect using HTML:


```html

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Marquee Example</title>

    <style>

        .marquee {

            width: 100%;

            overflow: hidden;

            white-space: nowrap;

            box-sizing: border-box;

        }


        .marquee span {

            display: inline-block;

            padding-left: 100%;

            animation: marquee 10s linear infinite;

        }


        @keyframes marquee {

            0% {

                transform: translate(0, 0);

            }

            100% {

                transform: translate(-100%, 0);

            }

        }

    </style>

</head>

<body>

    <div class="marquee">

        <span>This is a simple marquee text example.</span>

    </div>

</body>

</html>

```


This example uses CSS animations to create a marquee effect. The `marquee` class is applied to a `div` element, and the text is wrapped in a `span` element. The `@keyframes` rule is used to define the animation, which moves the text from right to left.

No comments:

Post a Comment