乱码乱a∨中文字幕,在线免费激情视频,亚洲欧美久久夜夜潮,国产在线网址

  1. <sub id="hjl7n"></sub>

    1. <sub id="hjl7n"></sub>

      <legend id="hjl7n"></legend>

      當(dāng)前位置:首頁(yè) >  站長(zhǎng) >  編程技術(shù) >  正文

      如何讓你的htmlbutton本身居中的實(shí)現(xiàn)

       2020-11-17 13:31  來(lái)源: 腳本之家   我來(lái)投稿 撤稿糾錯(cuò)

        阿里云優(yōu)惠券 先領(lǐng)券再下單

      這篇文章主要介紹了如何讓你的html button本身居中的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧

      如何讓你的html button本身居中呢? 這個(gè)很好找思路, 在其父標(biāo)簽中設(shè)置居中屬性啊, 如下:

      <html>
      <body>
       
      <center><button onClick="myClick()">hit me</button></center>
       
      <script>
      function myClick()
      {
       alert("123");
      }
      </script>
      </body>
      </html>

      或者:

      <html>
      <body>
       
      <div align="center"><button onClick="myClick()">hit me</button></div>
       
      <script>
      function myClick()
      {
       alert("123");
      }
      </script>
      </body>
      </html>

      #FormatStrongID_0#

      button是一個(gè)行內(nèi)塊級(jí)元素display:inline-block;

      所以處理方式很簡(jiǎn)單,可以用以下兩種方式:

      方式一:

       <div style="text-align:center"> 
       <button>按鈕居中</button>                     
       </div>

      方式二:

      <div>   
      <button  style="display:block;margin:0 auto">按鈕居中</button>                     
      </div>

      到此這篇關(guān)于如何讓你的html button本身居中的實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)html button居中內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!

      來(lái)源:腳本之家

      鏈接:https://www.jb51.net/web/731455.html

      申請(qǐng)創(chuàng)業(yè)報(bào)道,分享創(chuàng)業(yè)好點(diǎn)子。點(diǎn)擊此處,共同探討創(chuàng)業(yè)新機(jī)遇!

      相關(guān)標(biāo)簽
      html
      水平居中

      相關(guān)文章

      熱門排行

      信息推薦