JS Web Flex彈性盒子模型代碼實(shí)例
1.justify-content
<!DOCTYPE html><html lang='en'><head> <meta charset='UTF-8'> <meta name='viewport' content='width=device-width, initial-scale=1'> <title>Flexbox彈性盒布局</title> <style> .demo{ display: -webkit-flex; justify-content: space-between; } </style></head><style> </style><body><div class='demo'> <div>姓名: 張三</div><div>年齡: 26歲</div></div><div class='demo'> <div>性別: 男</div><div>生日: 1995-05-06</div></div><div class='demo'> <div>檢查編號: 25</div><div>住院號: 198</div></div></body></html>
效果圖
2.flex三行二列
<!DOCTYPE html><html lang='en'><head> <meta charset='UTF-8'> <meta name='viewport' content='width=device-width, initial-scale=1'> <title>Flexbox彈性盒布局</title> <style> .demo{ display: -webkit-flex; } .item-flex{ flex:1; } </style></head><style> </style><body><div class='demo'> <label class='item-flex'>姓名: 張三</label><label class='item-flex'>年齡: 26歲</label></div><div class='demo'> <label class='item-flex'>性別: 男</label><label class='item-flex'>生日: 1995-05-06</label></div><div class='demo'> <label class='item-flex'>檢查編號: 25</label><label class='item-flex'>住院號: 198</label></div></body></html>
效果圖
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。
相關(guān)文章:
1. .NET中實(shí)現(xiàn)對象數(shù)據(jù)映射示例詳解2. Ajax實(shí)現(xiàn)局部刷新的方法實(shí)例3. 通用 HTTP 簽名組件的另類實(shí)現(xiàn)方式4. javascript實(shí)現(xiàn)前端分頁效果5. .NET 8新預(yù)覽版使用 Blazor 組件進(jìn)行服務(wù)器端呈現(xiàn)(項(xiàng)目體驗(yàn))6. HTML5實(shí)戰(zhàn)與剖析之觸摸事件(touchstart、touchmove和touchend)7. 使用AJAX實(shí)現(xiàn)UTF8編碼表單提交到GBK編碼腳本無亂碼的解決方法8. 教你怎么用python selenium實(shí)現(xiàn)自動化測試9. Python通過類的組合模擬街道紅綠燈10. jsp+mysql實(shí)現(xiàn)網(wǎng)頁的分頁查詢
