Jump to content

Marquee Overflow

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

Link to comment
  • Replies 2
  • Views 1.8k
  • Created
  • Last Reply
  • 3 weeks later...

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.