Last active
March 2, 2023 06:48
-
-
Save ghostcode/16e05592da16ab088d21 to your computer and use it in GitHub Desktop.
Revisions
-
ghostcode revised this gist
Nov 2, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,8 @@ 水平垂直居中是前端的痛,也是前端__永恒__话题,这次记录两个用`display:flex`实现的方法:  第一种: ### html ### -
ghostcode revised this gist
Nov 2, 2020 . 1 changed file with 32 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ ``` <div class="flex"> <p>内容</p> </div> ``` @@ -17,21 +17,31 @@ display:flex; width:600px; height:600px; background-color:#ff9900; } .flex p{ margin:auto; /* 修饰作用 */ background-color: #000000; padding:20px; color:#fff; font-size:40px; font-weight:700; } ``` https://codepen.io/ghostcode/pen/WNxJdNN 第二种: ### html ### ``` <div class="flex"> <p>内容</p> </div> ``` @@ -46,6 +56,24 @@ height:600px; background-color:#333; } .flex{ display:flex; align-items:center; justify-content:center; width:600px; height:600px; background-color:#ff9900; } .flex p{ /* 修饰作用 */ background-color: #000000; padding:20px; color:#fff; font-size:40px; font-weight:700; } ``` https://codepen.io/ghostcode/pen/gOMzoOq -
ghostcode revised this gist
Nov 2, 2020 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,15 +2,15 @@ 第一种: ### html ### ``` <div class="flex"> <p>content content</p> </div> ``` ### css ### ``` .flex{ @@ -27,15 +27,15 @@ 第二种: ### html ### ``` <div class="flex"> <p>content content</p> </div> ``` ### css ### ``` .flex{ -
ghostcode revised this gist
Jul 11, 2014 . 1 changed file with 26 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ 水平垂直居中是前端的痛,也是前端__永恒__话题,这次记录两个用`display:flex`实现的方法: 第一种: ###html### @@ -22,5 +24,28 @@ margin:auto; } ``` 第二种: ###html### ``` <div class="flex"> <p>content content</p> </div> ``` ###css### ``` .flex{ display:flex; align-items:center; justify-content:center; width:600px; height:600px; background-color:#333; } ``` <a class="jsbin-embed" href="http://jsbin.com/cotequ/1/embed?html,output">JS Bin</a><script src="http://static.jsbin.com/js/embed.js"></script> -
ghostcode revised this gist
Jul 8, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,4 +23,4 @@ } ``` <a class="jsbin-embed" href="http://jsbin.com/cotequ/1/embed?html,output">JS Bin</a><script src="http://static.jsbin.com/js/embed.js"></script> -
ghostcode revised this gist
Jul 8, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,4 +23,4 @@ } ``` <a href="http://jsbin.com/cotequ/1/watch?html,output">xxx</a> -
ghostcode revised this gist
Jul 8, 2014 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,4 +21,6 @@ .flex p{ margin:auto; } ``` <a class="jsbin-embed" href="http://jsbin.com/cotequ/1/embed?html,output">JS Bin</a><script src="http://static.jsbin.com/js/embed.js"></script> -
ghostcode revised this gist
Jul 8, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,7 @@ display:flex; width:600px; height:600px; background-color:#333; } .flex p{ -
ghostcode created this gist
Jul 8, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ 水平垂直居中是前端的痛,也是前端__永恒__话题,这次记录一个用`display:flex`实现的方法: ###html### ``` <div class="flex"> <p>content content</p> </div> ``` ###css### ``` .flex{ display:flex; width:600px; height:600px; } .flex p{ margin:auto; } ```