Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
Autumn, 20 Oct 2026 - @957.35
Forum Activity: Four Stars Random | Recent Posts | Guild Recents
News: It's only life! :dog: Guild Events: Weekly zine jam 17: Fashion
Super News: ~~MelonLand's Halloween Profile Design Contest 2026~~
+  MelonLand Forum
|-+  Da Web Revival
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  CSS Marquees


« previous next »
Pages: [1] Print Embed
Author Topic: CSS Marquees  (Read 1449 times)
IndigoGolem
Sr. Member ⚓︎
****
View Profile WWW


What's personal text?
⛺︎ My Room
RSS: RSS
OS: Debian GNU/Linux

Guild Memberships:
Artifacts:
squeezed gentlyVisited on Melon's 10th Anniversary!I got robbed by Dan Q on Melonland!Joined 2025!
« on: Autumn, 27 Sep 2025 @648 » Embed

...but you can also do smoother marquees using CSS - this is the code the forum uses:

Code
<span class="marquee"><span>My scrolling text</span></span>

<style>
.marquee span {
    width: max-content;
    display: inline-block;
    animation: marquee 25s linear infinite;
    padding-left: 100%;
}

.marquee span:hover {
  animation-play-state: paused
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}
</style>

I'm trying to do some stuff with marquees* and i'm confused about it. I like this code better than how Firefox handles <marquee>, but i don't understand why the animation breaks if i change the display from inline-block to inline. Though that stopped mattering when i realized i need to make it position:absolute to fully fill the background.

When i use this same code in my site the image in the marquee jumps back to where it started when the animation finishes, instead of looping smoothly. I changed a few things like the timing and making it play on hover instead of pause on hover, but nothing that should break this. Maybe it's so smooth here because of some other styling that applies to <span> or <p>.

Has anyone figured out a way to make the marquee loop seamlessly instead of having a space? Repeating the image inside the inner <span> delays the problem but doesn't actually fix it.

My testing page no longer anywhere (oops). The box in the middle is to stop the background from scrolling when you hover over the middle of the page.


* Actual 3D spaces in CSS are hard so i'm trying to fake it with marquees that scroll to show a full 360° view of a space. Probably with either an image map or a CSS imitation image map for links.

« Last Edit: Spring, 28 Mar 2026 @704 by IndigoGolem » Logged

-Indigo, Anve Ozo

Artifact Swap: VaporfactSpiritual Stone of Firee  unus, pluriumHALLOWEEN!MelonPaintMick Jagger's mouthPuzzlingCreampuffNoid2 coinsThe fingerSeven SnailsGold OreOdd Creaturesnail buddy
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
@000 Melon
Land
Forum Art Hub Chat Webring Explore Random Recent Tenement Arcade Want to Login or Join ? Web Craft Guide Graphic Catalogue Wiki Help I'm Lost! Link Land Newsletters Image Stream Minecraft: Online
Zap!
Passport Sites tamaNOTchi Asatte Add your site?
Aero Archive Onio Cafe 32 Bit Cafe Status Cafe