I am working on a project with ReactJs and I want to make a background with a gradient from red to white and a logo will go on top.
I am using MUI and in the sx
props I put the below but the logo appears behind the gradient (background) instead I do place it on a normal background of a single color (backgroundColor) if the logo appears in front of me.
<Grid
item
xs={false}
sm={4}
md={20}
sx={{
backgroundImage: 'url(https://...)',
backgroundRepeat: 'no-repeat',
//backgroundColor: 'linear-gradient(0deg, rgba(195,34,34,1) 0%, rgba(249,249,249,1) 100%)'//Logo detras
background: "#D52323", //Logo delante
backgroundSize: '100%',
backgroundPosition: 'center',
}}
/>
</Grid>
When we talk about css the order of the properties matters, when you use individual properties the order is from top to bottom with the lower one being the priority and when you use a single property (background) the order is from left to right with the lower one being the priority. left, this is when you use commas to define the different options, in this case, different backgrounds, but if you don't use commas, all the backgrounds are applied in order, I leave you one last example that I think is what you want to do (see in full page)