Inline Conditional Media Query CSS is not working in ReactJS

Viewed 109

I am trying to solve the problem of height:100vh in Mobile Browser Like Safari, Chrome So I have written Dynamic CSS using JavaScript But It is not working in ReactJS

1. const homePage = {
2.    height:"calc(" + window.innerHeight + " - 80px)",
3.    '@media screen and (max-width:768px)':{
4.      height:"calc(" + window.innerHeight + " - 60px"
5.    },
6. }
7. return (
8.    <Fragment>
9.      <section className="nad-home-page" style={homePage}>
10.        <div className='container>...code going so on

enter image description here

Can you let me know What I am doing wrong ?

0 Answers
Related