Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

301
Views
CardMedia height material-ui

Im struggling trying to change the height of the image inside the CardMedia

Im setting the style with

const style = {
  height: 32,
};

and using it in

<CardMedia
  overlay={<CardTitle title="Title"/>}
  mediaStyle={style}>

  <img src="imgUrl" />
</CardMedia>

but the height of the image remains the same. The only thing that happens is that the overlay with the title moves to the top. I've tried all the CardMedia properties but i havent succeeded

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You need to apply the styles on the image directly:

<CardMedia overlay={<CardTitle title="Title"/>}>
  <img src={imgUrl} style={style}/>
</CardMedia>

Set desired width and height of the image, Card will adjust to the image.

over 4 years ago · Santiago Trujillo Report

0

try using style instead of mediaStyle, like

const Style = {
  height: 32,
};

    <CardMedia
      overlay={<CardTitle title="Title"/>}
      style={Style}>

      <img src="imgUrl" />
    </CardMedia>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!