0
I have an application that has the image in the same component folder, as in the image:
And I’m using the following inline code to put this image as background:
function App() {
// Imagem carregada da mesma pasta
const Background = './move-it.png';
return (
<div>
{/* Codigo inline tentando acessar a imagem */}
<div className="caixa" style={{ backgroundImage: 'url(' + Background + ')' }}>
teste
</div>
</div>
);
}
export default App;
But in the execution, it looks something like:
The only style I defined was:
.caixa {
display: flex;
align-items: center;
justify-content: center;
width: 100px;
height: 100px;
}