css多欄佈局程式碼例項
本章節分享一段程式碼例項,它實現了多欄佈局效果,需要的朋友可以做一下參考。
程式碼例項如下:
[HTML] 純文字檢視 複製程式碼<!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>螞蟻部落</title> <style> * { margin: 0; padding: 0; text-decoration: none; } .col-wrapper { padding: 20px; background-color: #9F8989; -webkit-column-width: 220px; /*多行佈局*/ -webkit-column-gap: 3rem; /*調節間距*/ -webkit-column-rule: 2px dotted #ccc; /*美化多列布局*/ } .col-wrapper h2 { -webkit-column-span: all; padding-bottom: .5rem; } .col-wrapper p { padding-bottom: 1rem; } .mainnav { width: 84%; background-color: #efefef; margin: 0 auto 1rem auto; padding: 1rem; } .mainnav ul { list-style-type: none; display: flex; justify-content: space-between; } .mainnav ul li { border: 1px solid #999; text-align: center; font-size: 150%; } .mainnav ul li a { padding: 10px; } </style> </head> <body> <div class="col-wrapper"> <h2>Extracts from "Our Cats, by Harrison Weir"</h2> <p>In our urban and suburban houses what should we do without cats? In our sitting or bedrooms, our libraries, in our kitchens and storerooms, our farms, barns, and rickyards, in our docks, our granaries, our ships, and our wharves, in our corn markets, meat markets, and other places too numerous to mention, how useful they are! In our ships, however, the rats oft set them at defiance; still they are of great service.</p> <p>How wonderfully patient is the cat when watching for rats or mice, awaiting their egress from their place of refuge or that which is their home! How well Shakespeare in Pericles, Act iii., describes this keen attention of the cat to its natural pursuit!</p> <p>A slight rustle, and the fugitive comes forth; a quick, sharp, resolute motion, and the cat has proved its usefulness. Let any one have a plague of rats and mice, as I once had, and let them be delivered therefrom by cats, as I was, and they will have a lasting and kind regard for them.</p> <p>A friend not long since informed me that a cat at Stone's Distillery was seen to catch two rats at one time, a fore foot on each. All the cats kept at this establishment, and there are several, are of the red tabby colour, and therefore most likely all males.</p> <p>I am credibly informed of a still more extraordinary feat of a cat in catching mice, that of a red tabby cat which on being taken into a granary at Sevenoaks where there were a number of mice, dashed in among a retreating group, and secured four, one with each paw and two in her mouth.</p> </div> <nav class="mainnav"> <ul> <li><a href="">Introductory</a></li> <li><a href="">The First Cat Show</a></li> <li><a href="">Habits</a></li> <li><a href="">Trained Cats</a></li> <li><a href="">Usefulness of Cats</a></li> </ul> </nav> </body> </html>
相關文章
- css彈性佈局程式碼例項CSS
- div css左右佈局例項程式碼CSS
- css九宮格佈局程式碼例項CSS
- css數字分頁佈局程式碼例項CSS
- css多列等寬分佈程式碼例項CSS
- css上面縮圖底部標題佈局程式碼例項CSS
- flex居中佈局程式碼例項Flex
- CSS3 Flex 彈性佈局例項程式碼詳解CSSS3Flex
- css3實現的瀑布流佈局程式碼例項CSSS3
- CSS 兩欄佈局和三欄佈局CSS
- 響應式佈局程式碼例項
- flex聖盃佈局程式碼例項Flex
- jQuery瀑布流佈局程式碼例項jQuery
- flex彈性佈局程式碼例項Flex
- CSS例項詳解:Flex佈局CSSFlex
- CSS佈局之三欄佈局CSS
- CSS:兩欄佈局CSS
- display: flex彈性佈局程式碼例項Flex
- CSS-Flex 佈局教程:例項篇CSSFlex
- 響應式佈局簡單程式碼例項
- CSS:三欄佈局之雙飛翼佈局CSS
- CSS-常見兩欄、三欄佈局(雙飛翼佈局、聖盃佈局)CSS
- CSS 三欄佈局之聖盃佈局和雙飛翼佈局CSS
- CSS 列表項佈局技巧CSS
- 12種常見的div+css佈局例項CSS
- CSS並不簡單:多欄佈局(Multi-Columns Layout)CSS
- css梯形程式碼例項CSS
- css左側欄固定右側欄寬度自適應程式碼例項CSS
- flex佈局語法+例項Flex
- Flex常見佈局例項Flex
- Flex 佈局教程:例項篇Flex
- CSS三欄佈局的四種方法CSS
- (中級)用CSS3表元實現多欄-中欄流動佈局CSSS3
- flex彈性佈局實現元素垂直居中效果程式碼例項Flex
- 常用兩欄佈局和三欄佈局
- css切角效果程式碼例項CSS
- CSS 對聯程式碼例項CSS
- css分割線程式碼例項CSS線程