這篇文章給大家分享的是有關(guān)bootstrap4設(shè)置模態(tài)框的方法的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧。
創(chuàng)新互聯(lián)建站專業(yè)為企業(yè)提供子長(zhǎng)網(wǎng)站建設(shè)、子長(zhǎng)做網(wǎng)站、子長(zhǎng)網(wǎng)站設(shè)計(jì)、子長(zhǎng)網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)與制作、子長(zhǎng)企業(yè)網(wǎng)站模板建站服務(wù),10多年子長(zhǎng)做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
模態(tài)框是覆蓋在父窗體上的子窗體。通常,目的是顯示來(lái)自一個(gè)單獨(dú)的源的內(nèi)容,可以在不離開父窗體的情況下有一些互動(dòng)。子窗體可提供信息交互等。
例如,通過(guò)點(diǎn)擊按鈕打開模態(tài)框。
<!DOCTYPE html> <html> <head> <title>Bootstrap 實(shí)例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h3>模態(tài)框?qū)嵗?lt;/h3> <!-- 按鈕:用于打開模態(tài)框 --> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal"> 打開模態(tài)框 </button> <!-- 模態(tài)框 --> <div class="modal fade" id="myModal"> <div class="modal-dialog"> <div class="modal-content"> <!-- 模態(tài)框頭部 --> <div class="modal-header"> <h5 class="modal-title">模態(tài)框頭部</h5> <button type="button" class="close" data-dismiss="modal">×</button> </div> <!-- 模態(tài)框主體 --> <div class="modal-body"> 模態(tài)框內(nèi)容.. </div> <!-- 模態(tài)框底部 --> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">關(guān)閉</button> </div> </div> </div> </div> </div> </body> </html>
我們可以通過(guò)添加 .modal-sm 類來(lái)創(chuàng)建一個(gè)小模態(tài)框,.modal-lg 類可以創(chuàng)建一個(gè)大模態(tài)框。
尺寸類放在 <div>元素的 .modal-dialog 類后 :
感謝各位的閱讀!關(guān)于bootstrap4設(shè)置模態(tài)框的方法就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!
當(dāng)前名稱:bootstrap4設(shè)置模態(tài)框的方法
網(wǎng)站鏈接:http://www.yijiale78.com/article36/pdspsg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、定制網(wǎng)站、動(dòng)態(tài)網(wǎng)站、網(wǎng)頁(yè)設(shè)計(jì)公司、網(wǎng)站排名、
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)