Tất cả bài viết | Bootstrap
Hướng dẫn cách định dạng hộp thông báo bằng Bootstrap
Trong bài thực hành này các Bạn sẽ được Hướng dẫn cách định dạng hộp thông báo bằng Bootstrap
Bước 1: Tạo cấu trúc HTML cho hộp thông báo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | < div class = "container" > < div class = "row" > < h2 class = "text-center" > Cách định dạng hộp thông báo bằng Bootstrap</ h2 > < div class = "col-md-12" > < div class = "alert alert-purple alert-dismissable" > < span class = "glyphicon glyphicon-certificate" ></ span > < button type = "button" class = "close" data-dismiss = "alert" aria-hidden = "true" > ×</ button > < strong >Chào mừng Bạn đến với website < a href = "http://hocwebgiare.com/" target = "_blank" >hocwebgiare.com</ a ></ strong > </ div > < div class = "alert alert-info-alt alert-dismissable" > < span class = "glyphicon glyphicon-certificate" ></ span > < button type = "button" class = "close" data-dismiss = "alert" aria-hidden = "true" > ×</ button > < strong >Chào mừng Bạn đến với website < a href = "http://hocwebgiare.com/" target = "_blank" >hocwebgiare.com</ a ></ strong > </ div > < div class = "alert alert-danger-alt alert-dismissable" > < span class = "glyphicon glyphicon-certificate" ></ span > < button type = "button" class = "close" data-dismiss = "alert" aria-hidden = "true" > ×</ button > < strong >Chào mừng Bạn đến với website < a href = "http://hocwebgiare.com/" target = "_blank" >hocwebgiare.com</ a ></ strong > </ div > < div class = "alert alert-warning-alt alert-dismissable" > < span class = "glyphicon glyphicon-certificate" ></ span > < button type = "button" class = "close" data-dismiss = "alert" aria-hidden = "true" > ×</ button > < strong >Chào mừng Bạn đến với website < a href = "http://hocwebgiare.com/" target = "_blank" >hocwebgiare.com</ a ></ strong > </ div > < div class = "alert alert-success-alt alert-dismissable" > < span class = "glyphicon glyphicon-certificate" ></ span > < button type = "button" class = "close" data-dismiss = "alert" aria-hidden = "true" > ×</ button > < strong >Chào mừng Bạn đến với website < a href = "http://hocwebgiare.com/" target = "_blank" >hocwebgiare.com</ a ></ strong > </ div > </ div > </ div > </ div > |
Bước 2: Định dạng CSS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | < style type = "text/css" >.alert-purple { border-color: #694D9F; background: #694D9F; color: #fff; } .alert-info-alt { border-color: #B4E1E4; background: #81c7e1; color: #fff; } .alert-danger-alt { border-color: #B63E5A; background: #E26868; color: #fff; } .alert-warning-alt { border-color: #F3F3EB; background: #E9CEAC; color: #fff; } .alert-success-alt { border-color: #19B99A; background: #20A286; color: #fff; } .glyphicon { margin-right:10px; } .alert a { color: yellow; }</ style > |
Bước 3: Gọi thư viện Bootstrap
1 | < link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" > <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"> </script> |
Bước 4: Gọi thư viện JQUERY
1 | <script src="js/jquery-1.11.1.min.js"> </script> |
Bootstrap Xem (3725) Học thiết kế web giá rẻ