怎么通過父容器,改變圖像顯示的大小,
<!doctype html>
<html>
<head>
? ? <meta charset="UTF-8">
<title>圖像</title>
<link rel="stylesheet" >
</head>
<body>
<div class="container">
? <div class="row">
? ? <div class="col-sm-4">
? ? ? <img? ?alt="140x140" src="http://placehold.it/140x140">
? ? ? ? <div>默認圖片</div>
? ? </div>
? ? <div class="col-sm-4">
? ? ? <img? class="img-rounded" alt="140x140" src="http://placehold.it/140x140">?
? ? ? ? <div>圓角圖片</div>
? ? </div>
? ? <div class="col-sm-4">
? ? ? <img? class="img-circle" alt="140x140" src="http://placehold.it/140x140">
? ? ? ? <div>圓形圖片</div>
? ? </div>
? ? ? <div class="row">
? ? ? ? <div class="col-sm-6">
? ? ? ? ? <img? class="img-thumbnail" alt="140x140" src="http://placehold.it/140x140">?
? ? ? ? ? ? <div>縮略圖</div>
? ? ? ? </div>
? ? ? ? <div class="col-sm-6" style="width: 1000px;height: 1000px;">? ? //我在這里都加了父容器的大小,但是感覺圖像大小沒變化啊????
? ? ? ? ? <img? class="img-responsive" alt="140x140" src="http://placehold.it/140x140" />?
? ? ? ? ? <div>響應(yīng)式圖片</div>
? ? ? ? </div>
? ? ? </div>
? </div>
</div>?
</body>
</html>
2019-07-08
看看你引入的CSS文件生效沒? 查看圖片元素看看.img-responsive這個class有沒有css屬性