移動端布局Demo測試

來源:互聯網
上載者:User

標籤:

上兩張圖自勉一下(來自劉墉先生的文章,最近看他的作品):然後移動端該愈來愈受到重視,未來的市場我不知道,不過我知道手機的功能越來越強大是不爭的事實!移動端布局的積累也需要從現在做起!

                              

需求一:實現效果,注意不同手機的型號:原生稱為適配,我們稱為自適應不變形

思路一:btn+ima布局風格

<div class="row margin-top">                        <div class="col-sm-12">                            <div class="form-group text-centr">                                <button type="submit" class="btn btn-default ubBtn">                                乘客快捷註冊                                <!-- <i class="check" style="padding-left:3.0rem">&nbsp;&nbsp;</i> -->                                <!-- <img src="./image/checks.png" style="width:20px;height:20px;position: relative;right: -1.6rem;"> -->                                </button>                                <img src="./image/checks.png" style="width: 20px; height: 20px; position: absolute; top: 3.6rem; right: 0.5rem;">                            </div>                        </div>                </div>
View Code

 

思路二:div 左右布局風格

<div class="row margin-top">                        <div class="col-sm-8">                            <button type="submit" class="btn btn-default ubBtn2" >                                新使用者註冊                            </button>                        </div>                        <div class="col-sm-4">                                <img src="./image/checks.png" style="width: 20px; height: 20px;float: right;margin-top: -1rem;margin-right: 0.3rem;">                         </div>                </div>
View Code

 

思路三:div 左右布局風格2 

<div class="row margin-top">                        <div class="col-sm-8">                            <a href="#" class="btn btn-a">新使用者註冊                                <span class="msg-span">&nbsp;&nbsp;&nbsp;&nbsp;</span>                            </a>                        </div>                        <!-- <div class="col-sm-4">                            <img src="./image/checks.png" style="width: 20px; height: 20px;float: right;margin-top: -1rem;margin-right: 0.3rem;">                        </div> -->                </div>
View Code

這個需要<span>有佔位,然後如果左側文字不定 做出來效果也不是很理想,適合固定的介面模式 然後設定span的左邊距離 

思路四:ul li a  span布局

思路五:期待補充中

 

統一css樣式整理:

.wrap-page{background:#ffffff;}.nav-box{text-align:center;margin-top: 1.0rem}.success{width:100%;margin:2.65625rem auto;}.share-txt{font-size: 0.4375rem}.logo{width: 3.109375rem;margin: 2.5625rem auto auto auto;}.top-blank{height:0.6875rem;}.top{background:#1FBAD6;height:10.0rem;}.content{position: fixed;left: 0.2rem;right: 0.2rem;top: 5.0rem;background: #ffffff;margin: auto 0;width: 96%;}.content-bg{width: 92%;margin: auto 0;position: relative;left: 0.4rem;}.div-select{background: #1FBAD6;margin-top: 0.4rem;padding: 0.25rem}.footer{height: 5.0rem}.margin-top{margin-top: 0.25rem;}.ubBtn{width:100%;margin:auto;display:block;height: 1.48rem;color:#1FBAD6;font-weight: 600}.ubBtn2{width:100%;margin:auto;display:block;height: 1.48rem;color:#1FBAD6;font-weight: 600}.check{background: url(../image/checks.png) right;background-repeat: no-repeat;background-size: 0.55rem 0.55rem;}.box4{margin: 0 auto;width: 10px;height: 0px;border: 20px solid transparent;border-bottom-color: #1FBAD6;}.btn-a{background:#ffffff;line-height: 28px;width: 100%;}.msg-span{background: url(../image/checks.png) right;background-repeat: no-repeat;background-size: 0.55rem 0.55rem;}
View Code

 

移動端布局Demo測試

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.