grid-image-002.html (1347B)
1 <!doctype html> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <title>Example of rule image with animated container size</title> 7 8 <style> 9 html,body { 10 color:black; background-color:white; font:20px/1 monospace; 11 } 12 13 @keyframes w { 14 0%, 33% { width:200px } 15 33%, 50% { width:400px } 16 50%, 100% { width:200px } 17 } 18 @keyframes h { 19 0%, 33% { height:200px } 20 33%, 50% { height:300px } 21 50%, 100% { height:200px } 22 } 23 24 .grid { 25 display: inline-grid; 26 grid-template-columns: repeat(3, 50px); 27 gap: 16px; 28 width: 200px; 29 height: 240px; 30 place-content: space-around; 31 32 animation: w 5s infinite, h 5s infinite; 33 34 column-rule: 16px solid blue; 35 column-rule-image: url(v-diagonal-blue-16.png) 16; 36 column-rule-extent: segment; 37 column-rule-align: rule-center; 38 column-rule-longitudinal-inset: -8px; 39 40 row-rule: 16px solid purple; 41 row-rule-image: url(h-diagonal-blue-16.png) 16; 42 row-rule-extent: segment; 43 row-rule-align: rule-center; 44 row-rule-longitudinal-inset: -8px; 45 46 border: 2px solid; 47 margin-right: 15px; 48 margin-bottom: 30px; 49 background: lightgrey; 50 } 51 52 x { 53 block-size: 48px; 54 background: grey; 55 } 56 x:nth-child(2), x:nth-child(6) { 57 grid-column: span 2; 58 } 59 60 </style> 61 62 <div class="grid test1"><x>1</x><x>2</x><x>3</x><x>4</x><x>5</x><x>6</x><x>7</x></div>