Why are the items I have inserted inside my <div> tag not appearing on the screen?

What could be simpler than this:

{this.state.dash ? 
                <div className='dashWrapper slide'>
                  HELLO
                </div> : null}

I've tried everything, but nothing seems to show up inside the div. I've spent so much time on this and I can't figure out why it's not working. The div itself displays fine, but anything I put inside it just doesn't show.

CSS:

.dashWrapper {
    width: 100%;
    height: 100vh;

    background: white;
}

.slide {
    position: absolute;
    bottom: -100%;

    -webkit-animation: slide 1s forwards;
    animation: slide 1s forwards;
    -webkit-animation-delay: 1s;
    animation-delay: 1s;
    -webkit-animation-duration: 1.5s;
    animation-duration: 1.5s;
}

@-webkit-keyframes slide {
    100% {bottom: 0;}
}

@keyframes slide {
    100% {bottom: 0;}
}

PLEASE SOMEONE HELP ME BEFORE I BREAK MY KEYBOARD :(

Full JSX

<div className='pageWrapper'>
          <div className='slides'>
            <div className='one' grey={this.state.grey}>
              <div className='chineseHeader'/>
              <div className='englishHeader'/>
              <div className='mePhoto'/>
              <div className='featuredWorkDivider'/>
              <div className='dash' onMouseDown={() => this.setState({grey: '1', dash: true})}/>
              <div className='allWorksDivider'/>
              <div className='allWorks'>
                <h1 className='work' onMouseDown={() => this.setState({grey: '1', busy: true})}>Busy Map</h1>
                <h1 className='work' onMouseDown={() => this.setState({grey: '1', oke: true})}>Oke</h1>
                <h1 className='work' onMouseDown={() => this.setState({grey: '1', scav: true})}>Scav Hunt</h1>
                <h1 className='work' onMouseDown={() => this.setState({grey: '1', van: true})}>Vanstrings</h1>
              </div>
            </div>
            {this.state.dash ? 
              <div className='dashWrapper slide'>
                <h1 className='back'>Back</h1>
              </div> : null}
            {this.state.busy ? <div/> : null}
            {this.state.oke ? <div/> : null}
            {this.state.scav ? <div/> : null}
            {this.state.van ? <div/> : null}
          </div>
        </div>

Answer №1

Consider modifying the dashWrapper class as shown below.

    .dashWrapper {
        width: 98%;
        height: 95vh;
        background: #f9f9f9;
    }

Keep in mind that making this change could potentially affect other elements, but on its own, it should resolve the issue with your slide up animation. It's challenging to provide specific CSS recommendations without a comprehensive overview of the application context.

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

Angular implementation of a dynamic vertical full page slider similar to the one seen on www.tumblr

I'm determined to add a full-page slider to the homepage of my Angular 1.x app After testing multiple libraries, I haven't had much luck. The instructions seem incomplete and there are some bugs present. These are the libraries I've experi ...

Customizing the behavior of the <Table /> component in the Antd UI library when there is no data

When the <Table /> component receives an empty data Array, I would like to display some custom content instead of just showing 'No data'. Is there a way to achieve this? ...

Ways to arrange comments to display the most recent ones at the top and older ones at the bottom when using Express or React

Currently, I am developing a MERN-stack Application that revolves around an Event model with multiple comments associated with each event. However, I am puzzled about how to organize these comments in such a way that the newest ones appear at the top, whil ...

Personalize the month titles in MUI DatePicker

Is there a method to modify the month name format from 3 words to full names? this is my current setup for instance, mui responsive datepicker displays: Jan - Feb - Mar - Apr - May I wish for it to show January - February - March and so forth. I have ...

Unable to successfully handle cookies in web browsers for a MERN application, with the backend deployed on Heroku and the frontend on Netlify

My MERN application has its backend hosted on Heroku and frontend on Netlify. Strangely, after deploying the app, I can't seem to view the cookies in the browser, even though everything functions as expected when running on localhost. Could this issue ...

Sublime Text 3 for React.js: Unveiling the Syntax Files

Currently, my code editor of choice is Sublime Text 3. I recently wrote a simple "hello world" example in React, but the syntax highlighting appears to be off. I attempted to resolve this issue by installing the Babel plugin, however, the coloring still re ...

How to process response in React using Typescript and Axios?

What is the proper way to set the result of a function in a State variable? const [car, setCars] = useState<ICars[]>([]); useEffect(() =>{ const data = fetchCars(params.cartyp); //The return type of this function is: Promise<AxiosRespo ...

Dynamic height adjustment for Bootstrap right column

I am struggling to create a layout with a right column using bootstrap. I can't figure out how to achieve the desired arrangement shown in this image. https://i.stack.imgur.com/VaIWD.png I have attempted various methods but the right column does not ...

Trouble With OnClick and On/Off Class Script Functionality in Chrome and Internet Explorer

I am working on a page with two iframes and a basic navigation bar. The navigation bar links are set up to target one of the iframes and replace its content when clicked. However, I am having trouble highlighting the currently selected link in the iframe - ...

The floated div is disrupting the flow due to its margin

Two divs are causing some alignment issues: one floated left and the other floated right. The margin on the right div is pushing it down, causing the left div to appear lower than desired. I want both divs to be aligned at the top of the page. HTML: < ...

Is it deemed as an anti-pattern to establish directives for styling?

Currently, I am in the midst of developing a specialized component UI library for a specific project I'm involved in. This library will consist of unique stylized components with elements that are reused throughout. As I work on this project, I find ...

Incorporated new code into the website, functioning properly, although it appears to keep scrolling endlessly below the footer

My website is experiencing a strange issue where the page seems to keep extending beyond the footer due to some JS code. I am not very familiar with JavaScript and have tried different solutions without success. I have searched extensively online for a so ...

The positioning of the Material Ui popover is incorrect

I am currently working on a web application project with React and have implemented Material UI for the navbar. On mobile devices, there is a 'show more' icon on the right side. However, when I click on it, the popover opens on the left side disp ...

React.js Filter Component

I'm currently trying to create a filter for my "localtypes", but I'm encountering an issue where the console in my browser is displaying an empty array. My goal is to access the localtypes properties of the API that I am working with. I attempte ...

Set the style properties of one class to match the style properties of another class using JavaScript

I need to dynamically create a div using the Bootstrap panel for displaying it. The div's class will either be "panel panel-success" or "panel panel-danger" based on the server response, which can be either "success" or "failure." To assign the class ...

Tips for downloading a file in React using raw file data

I've been struggling with a particular issue for the past couple of days and just can't seem to find a solution. It involves retrieving data from an API on our outdated system related to Attachments and other information. When I execute the query ...

Tips for effectively utilizing setFieldValue to transmit values as props among components

I am currently facing an issue while using ant design forms in my registration form. When attempting to use setFieldsValue, an error stating "Cannot use setFieldsValue unless getFieldDecorator is used" is being thrown. However, I have already implemented ...

When my viewport's size is less than 998px, a blank space appears

While configuring media queries in my HTML and CSS project, everything seemed to be working well. However, I noticed that when I shrink the screen, there is an empty white space on the right side and a horizontal scroll bar appears at the bottom without an ...

React useEffect is firing unexpectedly

One issue I'm facing is with a react component that has a prop passed by a redux connect method. I've linked a useEffect specifically to that prop to make an async call when it changes. However, the problem is that the useEffect fires every time ...

Appear and disappear gradually when hovering

When hovering over #one, the class .hidden is applied to #first. I have added a script to make .hidden fade out using transition: ease-in 0.3s;, but I am having trouble getting the fade in effect to work. I attempted adding transition: ease-in 0.3s; to #fi ...