我可以将“下一个/图像”中的元素图像放入{ position: absolute; left: 50% }
吗?似乎没有受到影响。
例子:
import React from 'react'
import Image from 'next/image'
import styled from 'styled-components'
const Container = styled.div`
position: relative;
`
const Test = styled(Image)`
position: absolute;
left: 50%;
`
const Page: React.FC = () => {
return (
<Container>
<Test src{someImg.webp} width={500} height={500} objectFit="none" />
</Container>
)
}
export default Page;