using antDesign, make those 2 elements appear on opposite sides of the screen. "<Header>…
- User
using antDesign, make those 2 elements appear on opposite sides of the screen. " <Title style={{ margin: 'auto', color: 'white', padding: '0' }} level={3}>CryptoTasky <Button style={{ backgroundColor: '#95A1F9', fontWeight: 'bold' }} type="primary" shape="round" icon={} size={size}> تسجيل
" - Assistant
To make the Header and the Button appear on opposite sides of the screen using antDesign, we can add a CSS property 'display: flex' to the Header element with 'justify-content: space-between'. This will push the elements to the opposite ends of the screen.
Here is an updated code snippet:
code<Header style={{ display: 'flex', justifyContent: 'space-between' }}> <Title style={{ color: 'white' }} level={3}> CryptoTasky </Title> <Button style={{ backgroundColor: '#95A1F9', fontWeight: 'bold' }} type="primary" shape="round" icon={<LoginOutlined />} size={size} > تسجيل </Button> </Header>By adding this CSS property, the Header and Button will be aligned on opposite sides of the screen without needing to use the Row and Col components from antDesign.
- User
those 2 elements are not vertically aligned, fix it. " <Row style={{ display: 'flex', justifyContent: 'space-between' }} align="middle"> <Title style={{ margin: 'auto', color: 'white', padding: '0' }} level={3}>CryptoTasky <Button style={{ backgroundColor: '#95A1F9', fontWeight: 'bold' }} type="primary" shape="round" icon={} size={size}> تسجيل
" - Assistant
To fix the vertical alignment of the two elements in the Header, we can add the
align-itemsproperty to thestyleattribute of theRowcomponent, and set its value to"center".Here's the updated code snippet:
code<Header> <Row style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}> <Col> <Title style={{ margin: 'auto', color: 'white', padding: '0' }} level={3}>CryptoTasky</Title> </Col> <Col> <Button style={{ backgroundColor: '#95A1F9', fontWeight: 'bold' }} type="primary" shape="round" icon={<LoginOutlined />} size={size}> تسجيل </Button> </Col> </Row> </Header>By adding
align-items: centerto thestyleattribute of theRowcomponent, the two elements will now be vertically aligned in the center of the Header.