Php 带图像和滚动条的Bootstrap 3模式
我有一个模态对话框,它有一个宽度为1500px的图像。我希望图像始终保持该大小,如果屏幕尺寸较小,我希望使用滚动条显示模式,即它应该保持自适应,但必须显示滚动条。因此,用户可以通过滚动模态体看到整个图像 我的情态:Php 带图像和滚动条的Bootstrap 3模式,php,html,css,twitter-bootstrap,yii2,Php,Html,Css,Twitter Bootstrap,Yii2,我有一个模态对话框,它有一个宽度为1500px的图像。我希望图像始终保持该大小,如果屏幕尺寸较小,我希望使用滚动条显示模式,即它应该保持自适应,但必须显示滚动条。因此,用户可以通过滚动模态体看到整个图像 我的情态: Modal::begin([ 'header' => Yii::t('app', ''), 'id' => 'mapModalId', 'class' =>'modal', ]);
Modal::begin([
'header' => Yii::t('app', ''),
'id' => 'mapModalId',
'class' =>'modal',
]);
echo $this->render('/site/map');
Modal::end();
/site/map.php
<img src="<?=Yii::getAlias('@web')."/images/map.png"?>" alt="">
“alt=”“>
如果您能提供演示,我将不胜感激。这其中有两个关键部分,完全是用CSS实现的
.modal-body {
overflow: scroll;
}
/* overrides the max-width: 100% that you may have on all images */
.modal-body img {
max-width: auto;
}