-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.html
46 lines (46 loc) · 1.5 KB
/
test.html
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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/pride-lite.css">
<style>
html, body {
margin: 0;
padding: 0;
}
#test {
width: 100vw;
display: grid;
grid-column-gap: 10px;
grid-row-gap: 10px;
padding: 10px;
grid-template-columns: auto auto auto auto auto auto auto auto;
}
div {
min-width: 150px;
min-height: 100px;
width: 150px;
height: 100px;
display: flex;
justify-content: center;
align-items: center;
color: white;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
font-family: sans-serif;
}
</style>
</head>
<body>
<div id="test"></div>
<script>
const testDiv = document.getElementById('test')
const classes = document.styleSheets[0].rules || document.styleSheets[0].cssRules
let newDiv
for (let i = 0; i < classes.length; i++) {
newDiv = document.createElement('div')
newDiv.classList.add(classes[i].selectorText.substring(1))
newDiv.innerText = classes[i].selectorText.substring(1)
testDiv.appendChild(newDiv)
}
</script>
</body>
</html>