body { display: flex; flex-wrap: wrap; gap: .5em 2em;}
p {position: absolute; background: white; top: 0; right: 0; margin: 0; z-index: 1; padding: .5em;}

div { --m: calc( 360deg / 16); width: 2px; height: 20px; background: #000; transform: rotate(var(--r, 0deg));}
div:nth-child( 8n + 1){ --r: calc(var(--m, 0) * 1) }
div:nth-child( 8n + 2){ --r: calc(var(--m, 0) * 2) }
div:nth-child( 8n + 3){ --r: calc(var(--m, 0) * 3) }
div:nth-child( 8n + 4){ --r: calc(var(--m, 0) * 4) }
div:nth-child( 8n + 5){ --r: calc(var(--m, 0) * 5) }
div:nth-child( 8n + 6){ --r: calc(var(--m, 0) * 6) }
div:nth-child( 8n + 7){ --r: calc(var(--m, 0) * 7) }
div:nth-child( 8n + 8){ --r: calc(var(--m, 0) * 8) }