css樣式控制元素固定在底部

來源:互聯網
上載者:User

標籤:style   blog   io   ar   os   使用   sp   java   for   

回複固定在底部:css樣式用到了

box-sizing屬性

box-sizing:border-box;-moz-box-sizing:border-box; /* Firefox */-webkit-box-sizing:border-box; /* Safari */

box-sizing 屬性允許您以特定的方式定義匹配某個地區的特定元素。

例如,假如您需要並排放置兩個帶邊框的框,可通過將 box-sizing 設定為 "border-box"。這可令瀏覽器呈現出帶有指定寬度和高度的框,並把邊框和內邊距放入框中。

 

為元素設定的寬度和高度決定了元素的邊框盒。

就是說,為元素指定的任何內邊距和邊框都將在已設定的寬度和高度內進行繪製。

通過從已設定的寬度和高度分別減去邊框和內邊距才能得到內容的寬度和高度。

 

 

position:absolute      絕對布局

bottom:0      距離底部的距離

 

 

<div class="page" id="forum_details" data-pageTitle="查看全文">    <div class="all_text">        <div class="talk_item">            <div class="top">                <span class="fr">話題12</span>                <h2>                    暱稱123<strong>07-19</strong>                </h2>            </div>            <p class="mid">                兩市今天漲跌互現,個股活躍度雖然較低,但估值較適中、有成長性或者在改革大勢裡有成長潛力的公司得到市場認同            </p>        </div>        <div class="all_text_reply">            <p>                <strong>張三:</strong>根據證券經紀業務的相關規定及財富證券集中交易系統使用規。            </p>            <p class="reply">                <strong>王五 回複 張三:</strong>根據證券經紀業務的相關規定及財富證券集中交易系統使用規。            </p>        </div>    </div>    <div style="width: 100%; padding: 0 1.5rem; box-sizing: border-box; position: absolute; bottom: 0;">        <a href="javascript:void(0);" class="mod_btn">回 複</a>    </div>    <!-- 彈窗 -->    <div class="window" style="display: none;">        <div class="window_area">            <textarea name="comment" id="comment" cols="30" rows="10"                placeholder="140個字以內"></textarea>            <span class="btn_box"> <a href="javascript:void(0);"                class="cancel">取消</a> <a href="javascript:void(0);" class="ok">發送</a>            </span>        </div>    </div></div>

  

css樣式控制元素固定在底部

聯繫我們

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