Scrolling effect made with CSS for displaying a carousel of logos

Seeking assistance in creating a LOGO slider that seamlessly transitions at the end. I have resorted to duplicating a section to ensure continuous movement.

I opted for using the translateX value for the animation effect.

.box {
  width: 600px;
  //overflow: hidden;
  margin: 100px auto;
  position: relative;
  background: white;
  height: 100px;
  padding: 20px;
}

.lst-box {
  //white-space: nowrap;
  animation: loop 6s linear infinite;
  position: absolute;
  width: 2500px;
  left: 0;
}

.lst-box li {
  display: inline-block;
  width: 49%;
  float: left;
}

.lst-box li .item {
  width: 200px;
  height: 100px;
  background: tomato;
  line-height: 100px;
  text-align: center;
  font-size: 50px;
  color: white;
  display: inline-block;
}

@keyframes loop {
  0% {
    left: 0;
  }
  100% {
    left: -200%;
  }
}

.lst-box li:nth-child(2) .item {
  background: green;
}
<div class="box">
  <ul class="lst-box">
    <li>
      <div class="item">1</div>
      <div class="item">2</div>
      <div class="item">3</div>
      <div class="item">4</div>
      <div class="item">5</div>
      <div class="item">6</div>
    </li>
    <li>
      <div class="item">1</div>
      <div class="item">2</div>
      <div class="item">3</div>
      <div class="item">4</div>
      <div class="item">5</div>
      <div class="item">6</div>
    </li>
  </ul>
</div>

https://jsfiddle.net/vg7c5aan/1/

Appreciate your help

Answer №1

.section{
  padding: 10px;
  background: tomato;
}
.container{
  width: 358px;
  height: 40px;
  margin: 0 auto;
}
ul{
  position: relative;
  list-style: none;
  padding: 0;
  border: 1px solid black;
  margin: 0;
  height: 40px;
  overflow: hidden;
}
li div{
  width: 60px;
  height: 40px;
  display: inline-block;
  text-align: center;
  line-height: 40px;
  margin-right: -4px;
}
li{
  position: absolute;
  background: white;
  margin-right: -4px;
}
.one div:nth-child(odd){
  background: orange;
}

.two div:nth-child(odd){
  background: green;
}
.one{
  animation: moveOne 4s linear infinite;
}
.two{
  animation: moveTwo 8s linear infinite;
}
@-webkit-keyframes moveOne {
  0% {
    transform: translate(0,0);
  }
  50% {
    transform: translate(-100%,0);
  }
  50.1%{
    transform: translate(100%,0);
  }
  100%{
    transform: translate(0,0);
  }
}
@-webkit-keyframes moveTwo {
  0% {
    transform: translate(100%,0);
  }
  50% {
    transform: translate(-100%,0);
  }
  50.1%{
    transform: translate(100%,0);
  }
  100%{
    transform: translate(-100%,0);
  }
}
<div class="section">
<div class="container">
  <ul class="lst-container">
    <li class="one">
      <div class="item">1</div>
      <div class="item">2</div>
      <div class="item">3</div>
      <div class="item">4</div>
      <div class="item">5</div>
      <div class="item">6</div>
    </li>
    <li class="two">
      <div class="item">21</div>
      <div class="item">22</div>
      <div class="item">23</div>
      <div class="item">24</div>
      <div class="item">25</div>
      <div class="item">26</div>
    </li>
  </ul>
</div>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to create a dropdown menu that smoothly slides in from the bottom of the screen?

Is it possible to create dropdown menus in the navigation bar that slide in from the bottom with a smooth transition effect, similar to this example: Although I am working on building my own template, so my code may differ from the original theme. Here is ...

Is it possible in PHP to iterate through a query and sort it into a designated column according to a specific value?

I'm working with Laravel and trying to display data from a query in an HTML table. The table contains columns such as id, user, and shift. There are around 100 entries, with the shift column containing values like A, B, C, or D. My goal is to organize ...

Tips for creating Java code that generates visually appealing colored HTML from JSON data include:1. Use libraries like Gson or Jackson

On certain pages dedicated to our API, such as for sales, we want to showcase JSON examples. We are looking for a nicely formatted display with color-coded spans. While the option of using the JavaScript code prettifier from this archived and unmaintaine ...

Enhance the speed of webview on Android devices

I have been working on an application that utilizes a webview to load both HTML and JavaScript files. Unfortunately, I have noticed a significant decrease in performance when displaying the content. Despite trying various solutions such as: webVi ...

Using Node.js and Less to dynamically select a stylesheet source depending on the subdomain

Currently, my tech stack consists of nodejs, express, jade, and less. I have set up routing to different subdomains (for example: college1.domain.com, college2.domain.com). Each college has its own unique stylesheet. I am looking for a way to selectively ...

Can JavaScript be Utilized to Create Dynamic Layouts Successfully?

Are you curious about the viability of using Javascript to create fluid website layouts? While it is possible, how does it compare in terms of performance and complexity when compared to other methods like CSS3/HTML5? Take a look at the function below that ...

Pressing a button through xpath

I am attempting to click on the button below: <div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"> <div class="ui-dialog-buttonset"> <button class="ui-button ui-widget ui-state-default ...

What is causing my HTML file path to function on my server, but not when I access the HTML file directly?

My file structure is organized as follows: The main file is located in the folder "HTML-Project/index.html". Within this folder, I have my style.css file and two other folders: one for pictures (HTML-Project/pictures) and another for categories (HTML-Proje ...

Can variables be transmitted through Real-Time Communication in JavaScript?

Currently, I am in the process of developing a multiplayer game using three.js. The basic framework is all set up and my next step is to implement the multiplayer aspect. After some research, I came across RTC as a solution that doesn't require comple ...

The header bar intrudes into the main content area

I am in the process of transitioning my landing page design from Bootstrap to Semantic-UI. The layout includes a fixed top navbar and main content split into two columns (3-cols and 9-cols) - the left column is reserved for a sidebar, while the right colum ...

Binding event listeners to dynamically created elements poses a challenge

I am facing difficulty in adding an event listener to dynamically created elements. The issue lies in my code where I am unable to detect the insertion of <p> element resulting in the lack of console message Bar Inserted. Could you point out if there ...

I am having trouble with my image not resizing properly within the flexbox when using height and max-height properties

In my flexbox setup, I have two columns, each taking up 50% of the width. My goal is to insert a large square image in the right column, with its height being determined by the contents' height in the left column. (Additional content will be added to ...

iOS devices do not support the add/removeClass function

This code functions properly on desktop browsers, but encounters issues when used on iPhones. Furthermore, the script mentioned below seems to be causing problems specifically on iPhone devices. var $event = ($ua.match(/(iPod|iPhone|iPad)/i)) ? "touchstar ...

Issues with displaying HTML5 audio player in iOS Chrome and Safari browsers

My html5/jquery/php audio player is working well on desktop browsers, but when I tried testing it on iOS, all I could see was a grey track bar. I suspect that the controls are hidden behind the track bar because sometimes the associated file starts playing ...

Tips for overlaying text on the background in Next.js:

I'm currently working on creating an image element with overlay text. Check out my jsx code below: <div className={styles.img}> <img src={src} alt="" /> <p>{`(${size})`}</p> </div> And here is t ...

Using jQuery in Rails 3 to display the id of a td element

I am working with a 3x3 table that contains td elements with unique id's (id='a1'...id='c3'). I want to enable the user to click on any of these 9 td elements and receive an alert displaying the id of the clicked td. Below is my C ...

"Encountering a problem with a function showing an undefined error

Trying to incorporate a slider feature into my application led me to reference this w3schools sample. However, upon loading the page, the images briefly appear before disappearing. Additionally, clicking on the arrow or dots triggers an error stating: U ...

Challenges with navbar and CSS alignment in Internet Explorer

Looking for some assistance with a HTML/CSS issue... I've created a new menu using the following CSS and code, but I'm encountering a problem with extra space between lines of text within the menu (specifically with the 'big' and &apos ...

Unable to display the complete JSON data using ng-repeat in AngularJS

Utilize ng-repeat to display data retrieved from a web service. Below is my controller JS (GetAllCtrl.js): https://i.stack.imgur.com/GAelG.jpg I have received JSON data: https://i.stack.imgur.com/0xkAU.jpg My goal now is to extract only company informati ...

Repairing the Left-sided Popup Leaflet

Can someone help me with fixing the positioning of the Popup to the left of the map? Currently, it does not stay aligned to the left edge when moving the map. I tried using position: fixed in my styling, and while everything looks good when zooming, it br ...