在 React JS 的样式化组件中,我以百分比形式给出了 div 的宽度,以使其具有响应性……但是 div 在右侧得到了边距,这使得对齐受到干扰。如何摆脱这个边缘。
export const BannerHeaderText = styled.h1`
width: 46.5%;
height: 64px;
font-size: 28px;
font-weight: 600;
line-height: 1.14;
`
export const BannerParagraph = styled.p`
width: 51.4%;
height: 40px;
margin-top: 8px;
font-size: 16px;
line-height: 1.5;
color: #000000;
opacity: 0.38;
`
我得到了我需要的宽度。
<BannerParagraphBlock>
<BannerHeaderText>
Solveing the most common problems in marketing
</BannerHeaderText>
<BannerParagraph>
Exquisite codially mr happiness of neglected distrusts.
Boisterous impossible unaffected he me everything.
</BannerParagraph>
<SeeAllProductsButton>{message.SayEffectHomePageSeeAllProductsButton.value}</SeeAllProductsButton>
</BannerParagraphBlock>
丢失的数据
BannerHeaderText 是 h1 而 BannerParagraph 是 p BannerParagraphBlock 是节