Created
March 25, 2014 11:12
-
-
Save hiloki/9759572 to your computer and use it in GitHub Desktop.
--- for demo style ---
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 characters
ul {/* ブロックな要素かつ幅を持っていれば、marginの左右をautoにすることで、中央寄せにできる。 */ | |
margin-left: auto; | |
margin-right: auto; | |
//width: 632px; | |
/* Debug */ | |
background-color: rgba(200,200,100,0.5); | |
} | |
li { | |
float: left; | |
margin-bottom: 20px; | |
width: 158px; | |
text-align: center; /* 中のimg要素はインラインブロックな要素なので、親要素がtext-align:centerをすると、中央に寄る */ | |
/* Debug */ | |
outline: 1px solid rgba(200,50,50,0.9); | |
} | |
/* --- for demo style --- */ | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
li { | |
list-style: none; | |
} | |
h1 { | |
margin: 30px; | |
} | |
img { | |
vertical-align: middle; | |
} | |
.clearfix:before, | |
.clearfix:after { | |
display: table; | |
content: ""; | |
} | |
.clearfix:after { | |
clear: both; | |
} |
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 characters
<ul class="clearfix"> | |
<li><img src="http://placehold.it/126/126"></li> | |
<li><img src="http://placehold.it/126/126"></li> | |
<li><img src="http://placehold.it/126/126"></li> | |
<li><img src="http://placehold.it/126/126"></li> | |
<li><img src="http://placehold.it/126/126"></li> | |
<li><img src="http://placehold.it/126/126"></li> | |
<li><img src="http://placehold.it/126/126"></li> | |
<li><img src="http://placehold.it/126/126"></li> | |
<li><img src="http://placehold.it/126/126"></li> | |
<li><img src="http://placehold.it/126/126"></li> | |
<li><img src="http://placehold.it/126/126"></li> | |
</ul> |
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 characters
// alert('Hello world!'); |
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 characters
{"view":"split-vertical","fontsize":"140","seethrough":"","prefixfree":"1","page":"html"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment