|
| 1 | +--- |
| 2 | +title: CSS - 使用CSS实现Mac窗口效果 |
| 3 | +date: 2018-08-15 05:42:55 |
| 4 | +updated: 2018-08-15 05:42:55 |
| 5 | +url: html-css/css-mac-window |
| 6 | +categories: |
| 7 | +- 前端开发 |
| 8 | +tags: |
| 9 | +- Css |
| 10 | +- Html |
| 11 | +--- |
| 12 | +来不及了,直接贴代码。 |
| 13 | +### HTML代码 |
| 14 | + |
| 15 | +```html |
| 16 | +<div class="user-bio"> |
| 17 | + <div class="user-bio-top"> |
| 18 | + <div class="circle-red"></div> |
| 19 | + <div class="circle-yellow"></div> |
| 20 | + <div class="circle-green"></div> |
| 21 | + </div> |
| 22 | + <div class="user-bio-body"> |
| 23 | + Wait,i know you<br> |
| 24 | + keep hungry keep foolish<br> |
| 25 | + 苍苍之天不可得久视,堂堂之地不可得久履,道此绝矣!<br/> |
| 26 | + 告后世及其孙子,忽忽锡锡,恐见故里,毋负天地,<br> |
| 27 | + 更亡更在,去如舍庐,下敦闾里!人固当死,慎毋敢佞。 |
| 28 | + </div> |
| 29 | +</div> |
| 30 | +``` |
| 31 | +<!-- more --> |
| 32 | +### CSS代码 |
| 33 | +主要是三个圆点 |
| 34 | +```css |
| 35 | +.user-bio { |
| 36 | + font-size: 14px; |
| 37 | + color: #6a737d; |
| 38 | +} |
| 39 | +.user-bio .user-bio-top { |
| 40 | + height: 15px; |
| 41 | + background-color: #E3E3E3; |
| 42 | + padding: 8px 12px; |
| 43 | + border-top-left-radius: 3px; |
| 44 | + border-top-right-radius: 3px; |
| 45 | +} |
| 46 | +.user-bio .user-bio-body { |
| 47 | + background-color: #EEEEEE; |
| 48 | + width: 100%; |
| 49 | + font-size: 13px; |
| 50 | + color: #666666; |
| 51 | + overflow: auto; |
| 52 | + padding: 20px; |
| 53 | + font-family: "Source Code Pro", Consolas, Menlo, Monaco, "Courier New", monospace; |
| 54 | +} |
| 55 | +.user-bio .user-bio-top div{ |
| 56 | + float: left; |
| 57 | + margin-right: 10px; |
| 58 | + width:13px; |
| 59 | + height:13px; |
| 60 | + background-color:#FF5F57; |
| 61 | + border-radius:50px; |
| 62 | +} |
| 63 | +.user-bio .user-bio-top .circle-yellow{ |
| 64 | + float: left; |
| 65 | + margin-right: 10px; |
| 66 | + width:13px; |
| 67 | + height:13px; |
| 68 | + background-color:#FFBD2E; |
| 69 | + border-radius:50px; |
| 70 | +} |
| 71 | +.user-bio .user-bio-top .circle-green{ |
| 72 | + float: left; |
| 73 | + margin-right: 10px; |
| 74 | + width:13px; |
| 75 | + height:13px; |
| 76 | + background-color:#28CA42; |
| 77 | + border-radius:50px; |
| 78 | +} |
| 79 | +``` |
| 80 | +### 最终效果 |
| 81 | + |
0 commit comments