1

I want the card header to be the normal text together with an image, side by side.

  import logo from './images/logo.svg';

  render() {
    return (
      <div>
        <Card>
          <Card.Content className='left aligned'>
            <div className="two column headers">
              <Card.Header>Hello World!</Card.Header>
              <Image src={logo} size='tiny'/>
            </div>
            <Card.Meta>Item</Card.Meta>
            <Card.Meta>Category</Card.Meta>
          </Card.Content>

          <Card.Content>
            <Card.Description>10 units of test.</Card.Description>
          </Card.Content>
        </Card>    
     </div>
    );

The image is appearing just after the 'Hello World!' header. How can I put them side by side, left aliging the text and right aligning the image ? Real image here

1 Answer 1

1

You can do this with CSS, however I will recomend to use Grid there.

<Card.Header>
  <Grid>
    <Grid.Column width={12}>Hello World!</Grid.Column>                
    <Grid.Column width={4}>
      <Image src={logo} size='tiny'/>
    </Grid.Column>
  </Grid>
</Card.Header>

By the way, if you want to have an Image component on left, you can use Header component, see examples.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.