The Transform feature doesn't seem to be functioning as expected within the Bootstrap

I was experimenting with creating a simple transform transition animation using css and js, so I wrote the following code:

(test page)


    <!DOCTYPE html>
<html>
    <head>
        <style type="text/css">
            *{
                margin:0;padding:0;
            }
            body{
                background-color:#000;
            }
            .fly-in-text{
                list-style:none;
                position:absolute;
                left:50%;
                top:50%;
                transform: translateX(-50%) translateY(-50%);
            }
            .fly-in-text li{
                display:inline-block;
                color: #d98c12;
                margin-right:50px;
                font-family:Open Sans,Arial;
                font-weight:300;
                font-size:4em;
                transition: all 2.5s ease;
            }
            .fly-in-text li:last-child{
                margin-right:0;
            }
            .fly-in-text.hidden li{
                opacity:0;
            }
            .fly-in-text.hidden li:nth-child(1){ transform: translateX(-200px) translateY(-200px); }
            .fly-in-text.hidden li:nth-child(2){ transform: translateX(20px) translateY(-20px); }
            .fly-in-text.hidden li:nth-child(3){ transform: translateX(-150px) translateY(-80px); }
            .fly-in-text.hidden li:nth-child(4){ transform: translateX(-150px) translateY(-200px); }
            .fly-in-text.hidden li:nth-child(5){ transform: translateX(10px) translateY(-200px); }
            .fly-in-text.hidden li:nth-child(6){ transform: translateX(-300px) translateY(200px); }
            .fly-in-text.hidden li:nth-child(7){ transform: translateX(20px) translateY(-20px); }
        </style>
    </head>
    <body>
        <ul class="fly-in-text hidden">
            <li>W</li>
            <li>E</li>
            <li>L</li>
            <li>C</li>
            <li>O</li>
            <li>M</li>
            <li>E</li>
        </ul>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
        <script type="text/javascript">
            $(function(){
                setTimeout(function(){
                    $('.fly-in-text').removeClass('hidden');
                },500);
            })();
        </script>
    </body>
</html>

After testing this animation on a standalone test page, I tried integrating it into my main site which uses Bootstrap. However, when I added the codes to my main site, the animation stopped working. Here is an excerpt from my main site code:

(main site)


    <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Daygostar Home Page</title>
    <link href="css/fly-text.css" rel="stylesheet">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    
    <!-- Other meta tags and script imports -->
  </head>
  
  <!-- Rest of the main site page structure -->

Upon removing the line that connects the Bootstrap CSS file, the text transition worked perfectly on my main site. This raised the question of why adding Bootstrap CSS caused the animation to fail.

I have saved the styles required for text transforms in a separate file named 'fly-text.css'.

The javascript part from the test page has been correctly included in the main site.

Answer №1

The problem lies within the .hidden class. Specifically, on line #6544 of the unminified boostrap.css file.

.hidden {
  display: none !important;
}

To solve the issue, simply delete this code and everything should function properly.

Answer №2

One possible solution is to consider adjusting the order in which CSS files are loaded, or alternatively placing bootstrap.min.css at the bottom of the page.

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

How do I resize an image to fit perfectly within the viewport dimensions?

As a beginner in Bootstrap and CSS, I am working on creating a home screen layout for my website. My goal is to ensure that the image with an intrinsic size of 1920x1080 fits perfectly within the viewport. Currently, part of the image extends off the scree ...

What is the name of the JavaScript code editor that includes line numbering for plain text?

Looking to incorporate a text area with line numbering features. I experimented with EditArea, but encountered difficulties when working with text files. While syntax highlighting for various programming languages would be a nice touch, my primary focus ...

Are there any find all functions available in JavaScript that are built-in?

I frequently work with arrays in JavaScript, and I am facing an issue with the function .find() as it only returns the first occurrence. I need a way to get all occurrences if there are multiple. Below is my code: const condition = [ { info_p ...

JavaScript maintaining records and connections between multiple asynchronous events

I am working on an Angular 10 project where users can compress and upload images to Google Cloud Storage. The compression and uploading functionalities are functional, but I'm facing challenges with managing the asynchronous process of handling multip ...

The validation of form fields using jQuery technology

There are moments when I wish I pursued a different career path and wasn't a web developer. This is one of those times. I have a form that requires validation for fields like postcodes and phone numbers. Here is the URL: Steps: Visit the URL Add ...

What is the best way to update the content of a text area using PyScript?

Currently, I am in the process of developing a program that involves entering text, clicking a button, processing it, and then displaying the output on a textarea. However, I'm faced with an issue where the textarea fails to update as expected. I woul ...

Customizing nested tables in your HTML email

When creating an HTML email template with nested tables for maximum email client support, the question arises about using inline styling. Should the style always be applied to the lowest level td, or is it possible to apply it to a parent table or td? For ...

What is the best way to use jQuery and "Long Polling" to dynamically update HTML pages on an Indy HTTP server?

After thoroughly reviewing the content in the article Simple Long Polling Example with JavaScript and jQuery, I came across a paragraph titled "Long Polling - An Efficient Server-Push Technique," which discusses the Long Polling technique merges the eff ...

Alter the border hue of the checkbox and radio button

Is there a way to modify the border color of checkboxes and radio buttons (both circle and rectangle) using CSS? I've attempted several methods with no success. Can someone provide guidance on this? Any advice would be greatly appreciated. Thank you ...

Checkbox Event Restricts Access to a Single Class Variable

As a beginner in AngularJS (just diving in this week), I've encountered an issue with a checkbox input connected to an ng-change event. <input type="checkbox" ng-model="vm.hasCondoKey" ng-change="vm.onKeyCheckboxChange()" /> The ng-change even ...

Failure to Fetch the Uploaded File's Value Using the Parameter

Objective: My aim is to automatically upload the second input named "file2" to the action result using jQuery code that is compatible with the latest versions of Firefox, Chrome, and Internet Explorer. Issue: The problem arises when HttpPostedFileBase ...

The information is being transmitted via an Ajax request, however, the PHP script is not able to

I am facing an issue with sending form data to a php script. Despite having what seems like correct Javascript and PHP code, the script is not receiving the data as expected. Before making the ajax request, the data appears to be in order. However, upon ...

How can Components access variables declared in a custom Vue.js plugin?

I had developed a unique Vue js plugin to manage global variables as shown below: CustomConstants.js file: import Vue from 'vue' export default { install(Vue){ Vue.CustomConstants = { APP_VERSION: '2.1.0' ...

JavaScript does not function properly with dynamically loaded content

Trying to load the page content using the JQuery load() method. See below for the code snippet: $(window).ready(function() { $('#content').load('views/login.html'); }); .mdl-layout { align-items: center; justify-content: center ...

Transfer a document to a php server using AJAX and jQuery in place of a traditional form

Is there a way to use AJAX for uploading files in PHP without reloading the page or performing additional functions? I want to keep it simple. Any suggestions? <form action="upload.php" method="post" enctype="multipart/form-data"> <label st ...

What is the best way to change a string that represents an array into an actual array?

Experimenting with something new... Imagine I have the following HTML code: <div id="helloworld" call="chart" width="350" height="200" value="[[4, 8, 1, 88, 21],[45, 2, 67, 11, 9],[33, 4, 63, 4, 1]]" label="['test1', ...

Having issues with setting up nodejs on kali linux

Whenever I try to execute the configure script ./configure for nodejs installation, it fails to run successfully. Traceback (most recent call last): File "./configure", line 19, in <module> from distutils.spawn import find_executable ModuleN ...

Transfer all the child nodes to the parent using the spread operator or Object.assign while preventing duplicate properties from being overwritten

I'm trying to transfer all the nodes of a child node to the parent using the spread operator or Object.assign (without relying on Lodash) while avoiding overwriting existing properties. My initial thought was to simply append the childArray to the ro ...

Switch the navbar background color from see-through to black

On my website, I have set up a navbar navigation that transitions between a transparent background and a black background as the user scrolls down. However, I would like the black background to be present at all times for the navbar. I built the website us ...

Assigning a JavaScript code block to execute exclusively on designated pages

I have implemented webpack to bundle all my .js files into one app.js, which is utilized across all pages in my project. However, I have encountered an issue where code intended for one page is impacting another page where it is not required. For example, ...