html IMG 标签水平居中 ,和图片过大 溢出处理


max-width: 100%;//父元素的宽度
display: block;
margin: 0 auto;

 

    display: table-cell; 垂直居中
    vertical-align: middle;

 

style="max-width: 100%;max-height: 100%; display:inline-block;"  //水平居中

 

  text-indent:50px; 段落首行缩进50个像素
    <style>
        ::-webkit-scrollbar { //隐藏滚动条
            display: none;
        }
    </style>

 

 

转载 https://segmentfault.com/a/1190000018279674

https://div.io/topic/1396

 

 

   <div style="width: 30%;display: inline-block;" class="code">
                            <div class="code-img" style="height: 34px;text-align: center;">
                                <img style=" display: inline-block;max-width: 100%;max-height: 100%;vertical-align: middle;"
                                    src="1.jpg" alt="" id="captchaImg">
                            </div>
                        </div>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM