bier hier bier hier - 15 days ago 6
React JSX Question

How to keep text in same position?

In my reactjs app I have a collapse implemented but I would like to keep the text under this in the same position. I tried this css:

.cart{
position: relative;
top:70px;
}


This does not work, how can I keep the 'this stays here' in the same position, with for example some blurring if possible?

More code here: codepen

Answer

Try this:

working for me

HTML:

<head>
  <title>React JS</title>
</head>

<body>
  <div id="app"></div>
<p>this stays here</p>
</body>

</html>

CSS:

    html, body {
      margin: 0;
      font-family: 'Roboto', Arial, sans-serif;
      font-size: 1.2em;
    }

    .cart
    {
      position:relative;
    }

p {
  position: absolute;
  top:30px;
  z-index:-1;
}
Comments