Search code examples
javascriptcssreactjsstylesreact-bootstrap

how to take your block button in the center of list group in react-bootstrap


[]i want my button should be like that.but my button always stay in left1


Solution

  • I think the easiest way to do it is to just use a div! or you can create a custom component that does that for you.

    <ListGroup.Item>
      <div style={{ width: '100%', display: 'flex', justifyContent: 'center' }}>
        <Button variant="primary">Primary</Button>
      </div>
    </ListGroup.Item>