I am having trouble getting the perspective property to function correctly in my SCSS code

I am just starting out as a beginner. I have been practicing writing HTML and SCSS by following the code provided by my teacher. I carefully added each sentence one by one, checking to see if the new codes had the effect he suggested. Here is what I accomplished with HTML and SCSS:

HTML

<div class="banner">
    <div class="panel"></div>
    ...
</div> 

SCSS

body {
    background-color: #000;
    color: #fff;
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.banner {
    display: flex;
}
$width: 23px;
.panel {
    position: relative;
    width: $width;
    height: 110px;
   overflow: hidden;
   animation: rotate 6s infinite ease-in-out;
}

@keyframes rotate {
    from { transform: rotateX(0deg); }
    ...
}

...

Later on, my teacher added:

perspective: 500px;

to the body in SCSS, like this:

place-items: center;
    perspective: 500px;

Immediately upon making this change, the image on his screen changed, but nothing happened on mine. I am using a Windows 10 computer and I have tried viewing "index.html" on Google Chrome, Microsoft Edge, Mozilla Firefox, all without success.

I really want to complete this 3D animation by myself. Please assist me in figuring this out.

Answer №1

Include the CSS property perspective: 500px; in the styling of the .banner class

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 incorporate a sliding div into these CSS Message Bubbles?

Just dipping my toes into web development, so please bear with me. I am working on a prototype of a Messaging Application and have most of the basics sorted out. Now, I am adding some finishing touches to enhance user experience. My goal is to make it so t ...

CSS: Obtain a button and align it to the "a" element

Feeling a bit puzzled: https://i.stack.imgur.com/S7xKh.png In the image, there's a span button labeled "Navigation einblenden", and a span a tagged as "Suche". Despite styling them identically: In the CSS snippet, dispOpts is the parent span's ...

illuminate selected row in datatable using a jquery plugin

My data is displayed using the jQuery plugin DataTable, and everything appears to be working well. I am retrieving my data from PHP using AJAX. However, I encountered an issue when trying to highlight the row that was hovered over while navigating around ...

Prevent automatic scrolling by clicking when you reach the bottom

In order to replicate the issue I am experiencing, please click on the down button four times, and then click on the up button. You will observe that you need to click the up button one extra time for it to function properly. How can I detect when it has r ...

What is the reason for Firefox and Opera disregarding the max-width property when used within display: table-cell?

When viewing the code below, you may notice that it displays correctly in Chrome or IE with the image set to be 200px wide. However, in Firefox and Opera, the max-width style seems to be completely ignored. Is there a reason for this inconsistency across b ...

Achieving full-width container on mobile devices with Bootstrap

Despite my efforts in the CSS file, I am still struggling to get the container to take up the full width on mobile devices. Here is my CSS code: @media (max-device-width: 1024px) { .col-sm-2{ width: 100%; } .container { margin: 0 auto; width: ...

Loading tab content on click using jQuery

These tabs have a chrome-like appearance. When the first tab (Facebook) is clicked, it shows Facebook content. Clicking on the second tab (Twitter) displays the content of the first tab. Tabs three, four, and five show their respective contents without any ...

Issue with Chrome (2) preventing HTML5 video from loading using video.js

This particular question is identical to the one found at HTML5 video (video.js) not loading in Chrome, which unfortunately was left unresolved. When attempting to load only a mp4 source on Chrome, I encounter the following message in the console: Array[ ...

Is it possible to change the inner html to null during an active ajax request?

My goal is to have two separate data.html files inserted into two different HTML files without needing a click event. I want the structure of my data.html files to remain consistent, while allowing the template of my website to change dynamically by callin ...

Error message in the browser console: Uncaught TypeError - The function allSections.addEventListener is not recognized

Whenever I inspect my browser console, I keep encountering this error: Uncaught TypeError: allSections.addEventListener is not a function at PageTransitions (app.js:16:17) at app.js:33:1 I find it strange because my VS Code editor does not display any err ...

Angular Material Dropdown with Multi-Column Support

I'm working on customizing the selection panel layout to display items in multiple columns. However, I'm facing an issue where the last item in each column appears off-center and split, causing overflow into the next column instead of a vertical ...

Guide on how to refresh the page following a post

Currently in the process of building a form within OctoberCMS that triggers a PHP code block. HTML/Twig: {{ form_open({ request: 'onHandleForm' }) }} Please input a string: <input type="text" name="value"/> <input type="submit" ...

Guide on making a hybrid bar chart using both stacked and grouped bars in chartjs

I'm looking to design a bar chart with a specific format in mind: After checking out the documentation provided on the website for creating stacked bar charts here, I attempted to replicate it but couldn't achieve the desired result. I've ...

Choose from the dropdown menu and verify with a CAPTCHA

I am currently working on my website. I need help with implementing a dropdown menu that allows for selecting multiple options at once. Can anyone provide guidance on JavaScript validation and also captcha implementation? The current script only allows for ...

Issue with triggering local storage event in IE 11 Enterprise mode

Currently, my web application is operating in IE 11 enterprise mode due to compatibility issues with IE 8 (although IE 11 support is still pending). The usage of localStorage involves a certain action, such as redirecting to the logout page, whenever ther ...

Scrolling CSS Divisions Along the Horizontal Axis

.group { background: #000; margin-left: 25px; margin-right: 25px; padding: 15px; width: inherit; white-space: nowrap; overflow-x: auto; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; } .item { margin: 3px; backgro ...

Is there a way to customize the appearance of a clicked link using only CSS?

Is it possible to style a clicked link using only CSS in order to provide user feedback that the link has been clicked and is taking the desired action? While I could use JavaScript to listen for click events and apply a desired class for feedback, a CSS- ...

"Converting jQuery Form into a Wizard feature with the ability to hide specific steps

I'm working on a form where I need to hide a fieldset when a specific event is triggered. Inside the first fieldset, there is a select tag and when a certain option is selected, the second fieldset should be hidden. <form id="form1"> <fi ...

How do I change the default settings of Bootstrap accordion to collapsed upon loading?

Need help with implementing bootstrap accordions in an offcanvas navbar. Currently, when added to the navbar, they all load as extended (open) by default and I want them to be collapsed (closed) instead. How can I achieve this? See code snippet below. < ...

What is the best way to expand a footer's height to fill the remaining space on the screen?

Any idea how to achieve this look: Creating a footer that stretches to fill the remaining height of the screen at the bottom of the page. Can CSS make this happen? ...