我已经做了很多查找,但令人惊讶的是关于 reactstrap carousel 图像响应的文档很少。
我的 ReactStrap carousel 响应式调整大小,但图像没有。
我研究/尝试过的选项:
CSS 通过轮播组件本身中的 className 吗?这是我认为最好的一个,但我还没有找到可以正确调整图像大小的背景大小、高度和最大宽度的组合。
源集?鉴于轮播是一个组件,我不确定如何实现这个或任何其他内联属性
也许在轮播组件本身的某个地方?
或者我有更好的方法来修改图像吗?
或者@media 是通过 css 的答案?
`
const items = [
{
src: 'img1.png',
altText: '',
caption: ''
},
{
src: 'img2.png',
altText: '',
caption: 'Freedom Isn\'t Free'
},
{
src: 'img3.png',
altText: '',
caption: ''
}
];
class HomeCarousel extends Component {
constructor(props) {
super(props);
this.state = { activeIndex: 0 };
this.next = this.next.bind(this);
this.previous = this.previous.bind(this);
this.goToIndex = this.goToIndex.bind(this);
this.onExiting = this.onExiting.bind(this);
this.onExited = …Run Code Online (Sandbox Code Playgroud)