手機版網站頂部導航條的布局

來源:互聯網
上載者:User

標籤:ado   bsp   lin   margin   dcl   nav   html   line   uga   

:

手機版網站頂部導航條布局分為3塊:
1、左側返回上一頁按鈕(固定寬高)
2、右側功能表按鈕(固定寬高)
3、中間文字介紹(寬度自適應且文字置中)

要實現這個效果最簡單的辦法是2邊絕對位置,中間text-align-center

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>Document</title>    <style>        body{padding:0;margin:0;}        div, p, ul, ol, dl, dt, dd, form{margin:0;padding:0;}        *{box-sizing:border-box;}        .container-fluid{width:100%;min-height:50px;background:#080808;padding:0 10px;position:relative;}        .navbar-brand{font-size:18px;height:50px;line-height:20px;padding:15px;position:absolute;left:0;top:0;z-index:1;}        .navbar-text{line-height:50px;color:#ffffff;}        .text-center{text-align:center;}        .navbar-toggle{background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px;margin-bottom:8px;margin-right:15px;margin-top:8px;padding:9px 10px;position:absolute;right:0;top:0;z-index:1;}        </style></head><body>    <div class="container-fluid">        <a class="navbar-brand" href="javascript:history.go(-1);">            <span class="glyphicon glyphicon-menu-left"></span>        </a>        <p class="navbar-text text-center">商品詳情</p>        <button class="navbar-toggle" data-target=".top-menu" data-toggle="collapse">            <span class="icon-bar"></span>            <span class="icon-bar"></span>            <span class="icon-bar"></span>        </button>    </div></body></html>

 

手機版網站頂部導航條的布局

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.