What is the best way to transform all elements on a webpage into a dynamic scrolling marquee?

Is there a way to make every div in a web application scroll like a marquee? Perhaps by using a specific CSS class or other method? The application is built with Angular 4 and Bootstrap.

Answer №1

Experience this amazing Pure CSS Solution utilizing CSS animation.


Check out the Demo Below:

.marquee {
  width: 60%;
  /* Must have on Parent */
  overflow: hidden;
  font: 400 32px/1.5 Consolas;
  background: rgba(0, 0, 0, 0.7);
  padding-left: 15px;
  margin: 20px auto;
}

.marquee b {
  /* Necessary for Child*/
  white-space: nowrap;
  display: table-cell;
  color: cyan;
  vertical-align: baseline;
  /* Creating Infinite Loops */
  animation: rightToLeft 12s linear infinite;
  /* Marquee scrolls from right to left direction */
  animation-fill-mode: backwards;
  /* Setting a reference point at 0s */
  animation-delay: 0s;
}

.marquee b a {
  color: gold
}


/* Required for complex CSS animation */

@keyframes rightToLeft {
  0% {
    transform: translateX(20%);
  }
  100% {
    transform: translateX(-100%);
  }
}
<div class='marquee'>
  <b>You should read <i>“how to ask”</i>:&nbsp;<a href="https://stackoverflow.com/help/how-to-ask">https://stackoverflow.com/help/how-to-ask</a></b>
</div>

<div class='marquee'>
  <b>You can change the CSS ".marquee" class selector to "div" and then sit back and watch the chaos unfold.</b>
</div>

<div class='marquee'>
  <b>Making every div a scrolling marquee seems excessive and pointless.</b>
</div>

Answer №2

Have you experimented with the marquee html element? Please be aware that this feature is no longer recommended.

<marquee>The content in this section will scroll horizontally</marquee>

<marquee direction="up">The content in this section will scroll vertically</marquee>

<marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid">
  <marquee behavior="alternate">
    This text will bounce
  </marquee>
</marquee>

For more information, visit MDN reference

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 utilize XPATH effectively within scrapy?

Explore more here Check out this link too: https://i.stack.imgur.com/8bhzV.png If you are struggling with finding the red marked box number, take a look at the image on this link: https://i.stack.imgur.com/mca05.png Don't worry, I have provided my ...

Data object constructor is not triggered during JSON parsing

Currently, I am retrieving data from a server and then parsing it into TypeScript classes. To incorporate inheritance in my classes, each class must be capable of reporting its type. Let me explain the process: Starting with the base class import { PageE ...

creating and managing multiple redirect routes in vue.js application

const router = new VueRouter({ routes: [ {path: '*', redirect: '/'} } )} I have configured this as the default redirect route in my routes.js file. Now, I am wondering how I can set multiple redirect paths and trigger them ...

The background image item in C# Outlook Mail does not repeat as expected when used inline

Hey there, I need to set up an email campaign with data in the mail body and a background image. However, I'm running into issues with the background image repeating. When I try to prevent repetition using background-repeat: no-repeat;, the image does ...

What is the best way to position text at the bottom of an image using CSS?

Utilizing the jQuery Caption Plugin to showcase the image alt text when hovering over an image. Currently, the text is displaying at the top but I would like it to show at the bottom. Any suggestions on how to remedy this? Desired Outcome: Check out the ...

Another date selection option missing from the available choices

I stumbled upon this template: . I am facing an issue where the second div I added does not display the dates, months, and years when duplicated. Here's a snippet of the script: <div class="form-date"> <label for="birth_dat ...

Using Javascript to create a radio button group

Is there a way to trigger an alert message when all radio buttons are checked as 'no'? I currently am only able to check each radio button individually. //The method I currently know $('#attraction1').change( function(){ if ($(this ...

Utilizing Angular to retrieve a property from a JSON object and exhibit it as an image

I'm facing a challenge with displaying an image from JSON that is stored on an online API. Please excuse my limited knowledge in Angular as I have only been working with it for 2 weeks. The issue arises when I try to access the "image1" property from ...

What are some ways to achieve a smoother hover effect?

.proposal p{ font-size: 14px; color: #494949; margin-bottom: 15px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; line-height: 20px; max-height: 100px; -webkit-line-clamp: 3; -webkit-box-orient: vertical; } .proposal: ...

Using the .each() method in jQuery to dynamically assign an attribute to a parent element in JavaScript

I'm new to JavaScript and jQuery and I need help transitioning my code from jQuery to pure JS. Within my HTML, there are multiple parent divs each containing a child div. My goal is to assign a class to both the child and parent elements, with the p ...

AngularJS - How to Deactivate List Items

Currently, I am working on developing a breadcrumb navigation system using AngularJS. However, I am facing an issue where some of the links need to be disabled based on certain user requirements not being met. After researching the Angular documentation, ...

Utilizing Row and Column Layouts in Bootstrap for Ordering Angular Lists

Is it possible to use bootstrap and angular to display a list in columns like shown below? The first four entries should be placed in the first column before moving on to populate the second column. a e b f c g d h Below is an example cod ...

Angular HTTP client fails to communicate with Spring controller

Encountered a peculiar issue in my Angular application where the HttpClient fails to communicate effectively with the Spring Controller. Despite configuring proper endpoints and methods in the Spring Controller, the Angular service using HttpClient doesn&a ...

Issue with integrating Contact Form 7 HTML into Wordpress

I've revisited this question with a new "input" HTML tag Despite changing everything, CSS still isn't being applied. HTML Code : <form action="#" class="contact-one__form row"> <div class="col-lg-6"> ...

Show a picture without specifying its file location

Looking for Suggestions on a New Title I am interested in using a script as the source attribute for an image, like this : <img src="img.js"/> Note: I am open to using any programming language, whether it be javascript or php. Here is what my fol ...

Adjust the colors dynamically based on specific data within a loop

My task involves populating a table with data. Specifically, I am focusing on coloring the data in the first year column according to certain conditions. The desired outcome is as follows: +--------+------------+------+------+ | YEAR | 2022 | 2021 ...

Codeigniter's email functionality struggles to successfully deliver HTML-rendered content to Yahoo and LiveMail

Our codeigniter site utilizes the CI mail library to send emails. While Gmail displays the emails properly formatted, Hotmail and Yahoo only show the raw HTML code. The HTML template is called from a file named: emailer_temp.php <!DOCTYPE> < ...

How can a single item from each row be chosen by selecting the last item in the list with the radio button?

How can I ensure that only one item is selected from each row in the list when using radio buttons? <?php $i = 1; ?> @foreach ($products as $product) <tr> <td scope="row">{{ $i++ }}</td> <td>{{ ...

Exploring CSS shaders in a browser?

Which browser out there fully supports CSS shaders? ...

Several levels piled one on top of the other

I'm in the process of designing a section for a webpage using Bootstrap 3.0, and I want to layer three divs or sections on top of each other. The stacking order should be as follows: background "squares," footer, and foreground "squares" with images. ...