我創建了一個繁星點點的夜間動畫,但想知道是否有人有更好的方式將div「隨機」放在只有CSS?另外,我也很難反應。感謝您的時間!只是想學習。CSS隨機div放置和響應
檢查在http://codepen.io/anon/pen/MeeYWO?editors=1100
#star-bl:nth-of-type(5) {
left: -350px;
top: 225px;
}
#star-bl:nth-of-type(6) {
left: 750px;
top: 250px;
}
#star-bl:nth-of-type(7) {
left: -450px;
}
#star-sm:nth-of-type(8) {
left: -225px;
}
#star-sm:nth-of-type(9) {
left: 500px;
}
#star-sm:nth-of-type(10) {
left: -100px;
}
什麼是你想要做什麼呢? –
尋找一種更簡單的方法來編碼星型配置,而不是重複n次(x)次 – user3393940