Line 1: | Line 1: | ||
− | + | /* Hexagons */ | |
− | + | #hexGrid { | |
− | + | overflow: hidden; | |
− | # | + | width: 90%; |
− | + | margin: 0 auto; | |
− | + | padding: 0.866% 0; | |
− | # | + | font-family: 'Banaue', sans-serif; |
+ | font-size: 20px; | ||
+ | } | ||
+ | |||
+ | #hexGrid:after { | ||
+ | content: ""; | ||
+ | display: block; | ||
+ | clear: both; | ||
+ | } | ||
− | . | + | .hex { |
position: relative; | position: relative; | ||
− | + | list-style-type: none; | |
− | + | float: left; | |
− | + | overflow: hidden; | |
− | + | visibility: hidden; | |
+ | outline: 3px solid transparent; /* fix for jagged edges in FF on hover transition */ | ||
+ | transform: rotate(-60deg) skewY(30deg) translatez(-1px); | ||
} | } | ||
− | . | + | .hex * { |
− | + | ||
− | + | ||
position: absolute; | position: absolute; | ||
− | + | visibility: visible; | |
− | + | outline: 3px solid transparent; /* fix for jagged edges in FF on hover transition */ | |
− | + | ||
} | } | ||
− | . | + | .hexIn { |
− | + | display: block; | |
− | + | width: 100%; | |
+ | height: 100%; | ||
+ | text-align: center; | ||
+ | color: #fff; | ||
+ | overflow: hidden; | ||
+ | transform: skewY(-30deg) rotate(60deg); | ||
} | } | ||
+ | /*** SPACING AND SIZING *****************************************************************/ | ||
− | + | @media (min-width:1201px) { /* <- 2-3 hexagons per row */ | |
− | + | .hex { | |
− | + | width: 32.666%; /* = (100-2) / 3 */ | |
− | + | padding-bottom: 37.720%; /* = width / sin(60) */ | |
+ | } | ||
+ | .hex:nth-child(5n+1), | ||
+ | .hex:nth-child(5n+2) { | ||
+ | transform: translateX(50%) rotate(-60deg) skewY(30deg); | ||
+ | } | ||
+ | .hex:nth-child(5n+3), | ||
+ | .hex:nth-child(5n+4), | ||
+ | .hex:nth-child(5n+5) { | ||
+ | margin-top: -8.564%; | ||
+ | margin-bottom: -8.564%; | ||
+ | } | ||
+ | .hex:nth-child(5n+2), | ||
+ | .hex:nth-child(5n+4) { | ||
+ | margin-right: 1%; | ||
+ | margin-left: 1%; | ||
+ | } | ||
+ | .hex:nth-child(5n+1) { | ||
+ | margin-left: 0.5%; | ||
+ | } | ||
+ | .hex:nth-child(5n+3), | ||
+ | .hex:nth-child(5n+6) { | ||
+ | clear: left; | ||
+ | } | ||
} | } | ||
+ | |||
+ | @media (max-width: 1200px) { /* <- 1-2 hexagons per row */ | ||
+ | .hex { | ||
+ | width: 49.5%; /* = (100-1) / 2 */ | ||
+ | padding-bottom: 57.158%; /* = width / sin(60) */ | ||
+ | } | ||
+ | .hex:nth-child(3n+1) { | ||
+ | transform: translateX(50%) rotate(-60deg) skewY(30deg); | ||
+ | } | ||
+ | .hex:nth-child(3n+2), | ||
+ | .hex:nth-child(3n+3) { | ||
+ | margin-top: -13.423%; | ||
+ | margin-bottom: -13.423%; | ||
+ | } | ||
+ | .hex:nth-child(3n+1) { | ||
+ | margin-left: 0.5% | ||
+ | } | ||
+ | .hex:nth-child(3n+3) { | ||
+ | margin-left: 1%; | ||
+ | } | ||
+ | .hex:nth-child(3n+2), | ||
+ | .hex:nth-child(3n+4) { | ||
+ | clear: left; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
</style> | </style> | ||
</head> | </head> | ||
<body> | <body> | ||
− | <div class=" | + | <div class="container-fluid page-heading"> |
+ | <div class="center"> | ||
+ | <img src="https://static.igem.org/mediawiki/2017/d/d1/T--Sydney_Australia--Team_Banner.png" class="banner img-center" width="100%" /> | ||
+ | </div> | ||
+ | <div class="row"> | ||
+ | <div class="col-xs-8"> | ||
+ | <ul id="hexGrid"> | ||
+ | <li class="hex" > | ||
+ | <a class="hexIn" id="alex-pic" href="#"> | ||
+ | <img src="https://farm9.staticflickr.com/8461/8048823381_0fbc2d8efb.jpg" alt="" /> | ||
+ | <h1>Alex Kelly</h1> | ||
+ | <p>Economics Eidolon</p> | ||
+ | </a> | ||
+ | </li> | ||
+ | </ul> | ||
+ | </div> | ||
+ | </div> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 11:47, 27 August 2017
/* Hexagons */
- hexGrid {
overflow: hidden; width: 90%; margin: 0 auto; padding: 0.866% 0; font-family: 'Banaue', sans-serif; font-size: 20px;
}
- hexGrid:after {
content: ""; display: block; clear: both;
}
.hex {
position: relative; list-style-type: none; float: left; overflow: hidden; visibility: hidden; outline: 3px solid transparent; /* fix for jagged edges in FF on hover transition */ transform: rotate(-60deg) skewY(30deg) translatez(-1px);
}
.hex * {
position: absolute; visibility: visible; outline: 3px solid transparent; /* fix for jagged edges in FF on hover transition */
}
.hexIn {
display: block; width: 100%; height: 100%; text-align: center; color: #fff; overflow: hidden; transform: skewY(-30deg) rotate(60deg);
} /*** SPACING AND SIZING *****************************************************************/
@media (min-width:1201px) { /* <- 2-3 hexagons per row */
.hex { width: 32.666%; /* = (100-2) / 3 */ padding-bottom: 37.720%; /* = width / sin(60) */ } .hex:nth-child(5n+1), .hex:nth-child(5n+2) { transform: translateX(50%) rotate(-60deg) skewY(30deg); } .hex:nth-child(5n+3), .hex:nth-child(5n+4), .hex:nth-child(5n+5) { margin-top: -8.564%; margin-bottom: -8.564%; } .hex:nth-child(5n+2), .hex:nth-child(5n+4) { margin-right: 1%; margin-left: 1%; } .hex:nth-child(5n+1) { margin-left: 0.5%; } .hex:nth-child(5n+3), .hex:nth-child(5n+6) { clear: left; }
}
@media (max-width: 1200px) { /* <- 1-2 hexagons per row */
.hex { width: 49.5%; /* = (100-1) / 2 */ padding-bottom: 57.158%; /* = width / sin(60) */ } .hex:nth-child(3n+1) { transform: translateX(50%) rotate(-60deg) skewY(30deg); } .hex:nth-child(3n+2), .hex:nth-child(3n+3) { margin-top: -13.423%; margin-bottom: -13.423%; } .hex:nth-child(3n+1) { margin-left: 0.5% } .hex:nth-child(3n+3) { margin-left: 1%; } .hex:nth-child(3n+2), .hex:nth-child(3n+4) { clear: left; }
}
</style>
</head>
<body>
<img src="" class="banner img-center" width="100%" />
-
<a class="hexIn" id="alex-pic" href="#">
<img src="" alt="" />
Alex Kelly
Economics Eidolon
</a>
</body>
</html>