我只是在玩HTML网页。你们中的任何一个人都可以帮助我理解为什么我的图像将容器边界向右延伸? https://codepen.io/Braindead16/pen/gRPZxe 点击链接查看完整的代码,看看我的意思是关于图像。图片扩展了我的容器边界
<div class="container">
<div class="jumbotron">
<h1 class="text-center"><em>Title</em></h1>
<div class="text-center image-box">
<img class="text-center img-responsive border"
src="https://www.sitebuilderreport.com/assets/facebook-stock-up-
446fff24fb11820517c520c4a5a4c032.jpg" alt="whatever">
<h2 class="image-text">this text decribes the image</h2>
</div>
我已经尝试将类应用于具有显示的图像:block;和余量:0自动; 我也尝试将自举列应用到图像和它的div,但没有任何东西使图像中心。
您*必须*发布所有的代码中的问题 –
如果你在最近的引导,引导4,'IMG-responsive'类成为'IMG-fluid' ,但那只会给你一个img它的父母的全部宽度。 https://v4-alpha.getbootstrap.com/content/images/ – marcx
快速向你的img上的codepen应用内联样式'max-width:100%'解决了这个问题,它应该与bootstrap的'img-流体' – marcx