提问者:小点点

我用BOOTSTRAP如何使图像充满和响应[关闭]


[在此处输入图像说明1]

如何使图像完整且响应迅速[1]:https://i.stack.imgur.com/g0unb.jpg


共1个答案

匿名用户

请做一点研究之前张贴堆栈溢出!您可以使用

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.responsive {
  width: 100%;
  height: auto;
}
</style>
</head>
<body>

<h2>Responsive Images</h2>

<p>If you want the image to scale both up and down on responsiveness, set the CSS width property to 100% and height to auto.</p>
<p>Resize the browser window to see the effect.</p>

<img src="img_nature.jpg" alt="Nature" class="responsive" width="600" height="400">

</body>
</html>

https://www.w3schools.com/howto/tryit.asp?filename=tryHow_CSS_Image_Responsive