Jump to content

Marquee Overflow

Go to solution Solved by Jordy_TheShop,

Recommended Posts

Hi,

I'm having trouble with a rotating text marquee on my site. I've successfully managed to put the marquee in using a code block, however I have site overflow and not sure how to fix it. I've tried fiddling the max width but no luck. Any help would be much appreciated.

HTML:

<h3>
<div class="marquee">
  <div class="track">
    <div class="content">&nbsp;SEO • MARKETING • WEB DESIGN • SOCIAL MEDIA MANAGEMENT • CONTENT CREATION • EMAIL • WEB DEV • PHOTOGRAPHY • VIDEO • SEO • MARKETING • WEB DESIGN • SOCIAL MEDIA MANAGEMENT • CONTENT CREATION • EMAIL • WEB DEV • PHOTOGRAPHY • VIDEO</div>

CSS:

//MARQUEE START//
.marquee {
  position: center;
  width: 150vw;
  max-width: none;
  height: 40px;
  padding-top: 3px !important;
  overflow-x: hidden;
}

.track {
  position: absolute;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 32s linear infinite;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
//MARQUEE END//

Screen Shot 2021-06-08 at 8.57.49 am.png

Edited by Jordy_TheShop
Link to comment
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 3 weeks later...
  • Solution

 

Yes I did – I ended up noodling around and the following CSS worked for anyone else needing this effect. 

 

//MARQUEE START//
.marquee {
  position: relative;
  width: 100vw;
  max-width: 100%;
  height: 40px;
  padding-top: 0px !important;
  overflow: hidden;
}

.track {
  position: absolute;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 32s linear infinite;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
//MARQUEE END//

 

Thanks,

Jordy 🙂

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.