What if react's jsx does not support backgroudSize,?

problem description

backgroundSize cannot be used in the jsx of react. How to achieve the same effect: fixed width and height, 100% width of the picture, height beyond hiding, so that the picture will not deform

related codes

     <div  style={{
                  background: `url("${head}")`,
                  backgroundRepeat:"no-repeat",
                  width: "3.75rem",
                  height: "3rem",
                  backgroundSize:"cover"
                }}></div>
Jun.02,2021

replace background with backgroundImage


background-size into background.
background: [background-color] [background-image] [background-repeat] [background-attachment] [background-position] / [background-size] [background-origin] [background-clip]


grammatical features in jsx:

react jsx syntax features:

write the backgroud-size attribute in jsx
backgroud should be replaced by backgroudImage;

< div style= {{
backgroundImage: url ("${head}") ,
backgroundRepeat: "no-repeat",
width: "3.75rem",
height: "3rem",
backgroundSize: "cover"
}} / >

Menu