Entrance Chat Gallery Guilds Search Everyone Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
October 03, 2025 - @981.00 (what is this?)
Activity rating: Four Stars Posts & Arts: 52/1k.beats Unread Topics | Unread Replies | My Stuff | Random Topic | Recent Posts Start New Topic  Submit Art
News: ozwomp is requesting your location  :ozwomp: [Agree] Guild Events: PowerPC Activity Week!

+  MelonLand Forum
|-+  World Wild Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  CSS Marquees


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


⛺︎ My Room

Artifacts:
Joined 2025!
« on: September 27, 2025 @648.28 »

...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 is here. 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.
Logged

Pages: [1] Print 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | ~ Send Feedback ~ 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