score:3
Accepted answer
you can change image size like below.
const imgstyle = {
maxheight: 128,
maxwidth: 128
}
<media object src={themes.image} style={imgstyle} alt={themes.name} />
note: react by default adds px to the numbers if we don't specify explicitly. here 128 is 128px
score:1
the list of props for media has classname
so you can give a class in your css file like,
.my_image{
height:100px;
width:100px;
}
and use the media as,
<media object src={themes.image} alt={themes.name} classname='my_image' />
Source: stackoverflow.com
Related Query
- Reactstrap Media object how to change the image size
- material UI - How can I change the font size of the label in FormControlLabel
- How can I change the label size of a material ui TextField?
- How to make the background image change every X seconds in React?
- How to change The style of a reactstrap modal in react?
- How do I shrink the size of an image in `react-image-gallery`?
- How to change the size of svg icon in React?
- reactstrap - how can I change the color of the <CarouselControl> 's (the small arrows on left/right you click to slide the photos)?
- How to change the object value in typescript?
- I am trying to animate an object with css in react and change the animation (timing) dynamically, how can I set the style after animation end?
- ReactJS and DraftJS, how to change font size on the fly?
- How to change the alignment of elements from flex-box in media queries?
- How to change the state object when one of the fields is an array?
- How to show the image links in an array of an object with map function in React?
- How to access JSON object in React where the keys change
- How can I change the font size for a <h1> in react bootstrap col?
- How to change image size using nextjs
- How to make image size dependent on the parents font size
- how to change the size and position of a rechart's pie chart using tailwind
- How change the size of UI Chip dynamically
- How to change the color of the image that is selected?
- How can I change the value of an object in an array in react redux when the action is called?
- How to change the value of the key form an object with the value of some another key of the same object?
- How can i change a state in react when I change the size of website?
- How to change the font size of the bullets of an unordered list item in draftjs?
- how can i change the parent iframe size from inside with javascript?
- Trying to figure out how to change background image depending on the genre of that particular book REACT
- How to keep the image and card in the same proportion of size in react bootstrap?
- How would I change the state/setState of an object nested in an array of an object in an array?
- How to keep the cup always in the middle without decreasing image size even when we decrease the window size?
More Query from same tag
- In ES6 with react, can I destructure an object just once for use in multiple methods?
- The value of the object always shows "undefined" in React
- Copy array of data to clipboard
- html full background color in Chrome(smartphone app)
- How to create infinity horizontal scroller
- Visualizing daily and weekly recording times in Django
- React - render component when clicking on a component which is not its child
- How to access properties in array of objects in react/javascript For-Loop & ForEach?
- Avoid passing around request object
- Any way we can access redux state value from older action
- How to apply transition in SASS?
- Reducer always returning initial state React-native
- event bubbling in react
- React app: Jest encountered an unexpected token
- React-typescript and rendering array of components
- Testing in React/Redux - how to guarantee that state has been updated?
- MUI v5 - Extending Typography variant in TypeScript creates error "No overload matches this call"
- Create-React-App: How to load static images properly
- How to consume this with webpack
- React with TypeScript - Property 'value' does not exist on type 'EventTarget'
- React Application Will "Flash" Default Page Before Redirecting An Authenticated User
- Second click on canvas is not being fired on mobile devices
- add third-party js library to Create React App
- Why can you only use expressions in JSX, not statements?
- reactjs - run build errors with svg objects
- Background image without specific height
- React Native async (firebase) image fetch in ScrollView / FlatList / SectionList
- Understanding documentation of React with redux
- Trigger completeMethod in PrimeReact Autocomplete on callback
- the title prop of a button must be a string - react native