- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hey there, I’m pretty new to CSS, and I’m trying to get a long list of words to scroll across the top of a website, but it only scrolls the first few words?
I’ve created a codepen link to show you what I mean:
https://codepen.io/hollyshortage/pen/VgGBmj
I am probably doing something really stupid – if anyone can help I’d really appreciate it! Thank you!!
At the bottom the CSS rule says it will go 950 pixels to the left but the element is much wider than that…
Edit – I’ve edited out what I added, seems a bit more complicated than I thought to solve smoothly.
I think I cracked it…
Thank you!!! :D you are my hero! It was driving me crazy. It’s so appreciated!
You’re welcome, it was a nice little puzzle actually. Note that this works best when the parent element has the full width of the screen – which in this case is in fact slightly less because of a few pixels of margin on body itself but that isn’t noticeable.
I also later realised you should better use this for the bit of style at the bottom, I forgot the prefix:
@-webkit-keyframes scroll {
0% {
-webkit-transform: translateX(100vw);
}
100% {
-webkit-transform: translateX(-100%);
}
}