css 图像被截断

Add*_*ddy 0 html css responsive-design twitter-bootstrap

我的页面上有一张图像,该图像从底部被咬掉。我有

html, body {
    max-width: 100%;
    overflow-x: hidden;

}
.image_button{
    border-radius: 20px;
    border: 5px solid #d3d3d3;
    float: left;
    margin-right:20px;
}
 image-responsive is present in bootstrap.
text-center is in bootstrap
Run Code Online (Sandbox Code Playgroud)

在我的代码中,但这只是为了避免页面上的侧滚动。有什么方法可以避免侧滚动并且不从底部剪切图像?

    <div id="gender" style="visibility: hidden ;" >
                           <h4 style="left: 20%; top: 10%;position: absolute; " class="text-center" ><b>Click on the female or male figure to select a gender.</b></h4>
                           <div style="left: 20%; top: 20%;position: absolute;" >
                           <img id="man" src="images/man.png"  onClick="pg4('bh'); sess2('gender male');" class="img-responsive image_button">
                           <img id="woman" src="images/woman.png" onClick="pg4('bh'); sess2('gender female');" class="img-responsive image_button">
                                                           <h4 style="left: 19%; top: 100%;position: absolute;" class="text-center" >Male</h4>
                           <h4 style="left: 67%; top: 100%;position: absolute;" class="text-center" >Female</h4>
                           </div>
        </div>
Run Code Online (Sandbox Code Playgroud)

图像的底部被剪切,这不是因为类“image_buttom”

And*_*L64 5

将其添加到您的 CSS 中:

img {
    width: 100%;
    height: auto;
}
Run Code Online (Sandbox Code Playgroud)

向图像添加唯一的类名称并替换img为该名称,以确保上述样式属性不会应用于您网站上的其他图像。