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