1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
| <!DOCTYPE html> <html lang="en">
<head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link href="//netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"> <style> * { margin: 0; padding: 0; }
body { width: 100vw; height: 100vh; background: #34495e; display: grid; }
main { display: grid; width: 400px; height: 200px; align-self: center; justify-self: center; grid-template: repeat(2, 1fr)/repeat(4, 1fr); }
div { text-align: center; background: #f1c40f; border: solid 1px #2c3e50; box-sizing: border-box; position: relative; }
div:nth-child(1)::before, div:nth-child(5)::before { animation-name: hd; animation-duration: 2s; animation-iteration-count: infinite; z-index: 2; }
div:nth-child(1)::before { content: "START"; width: 100px; height: 100px; background-color: #8e44ad; position: absolute; left: 0; top: 0; animation-timing-function: steps(4, start); }
div:nth-child(5)::before { content: "END"; width: 100px; height: 100px; background-color: #27ae60; position: absolute; left: 0; top: 0; animation-timing-function: steps(4, end); }
@keyframes hd { to { transform: translateX(400px); } } </style> </head>
<body> <main> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> </main> </body>
</html>
|