|
1 | 1 | /* assets/style.css */ |
2 | | -:root { --ink:#222; --bg:#f9f9f9; --link:#0b72d2; } |
| 2 | +:root { --ink:#222; --bg:#f9f9f9; --link:#0b72d2; --col:760px} |
3 | 3 |
|
4 | 4 | *{ box-sizing: border-box; |
5 | 5 | overflow-wrap: break-word; } |
|
8 | 8 | font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; |
9 | 9 | margin: 0.5rem; color: var(--ink); background: var(--bg); |
10 | 10 | } |
11 | | -header{ |
12 | | - border-bottom: #000001 dashed 1px; |
13 | | - height: 2rem; |
14 | | - display: flex; |
15 | | - justify-content: center; |
16 | | - text-align: center; |
17 | | - padding: 0; |
| 11 | +header nav{ |
| 12 | + /* border-bottom: #000001 dashed 1px; */ |
| 13 | + display: grid; |
| 14 | + grid-template-columns: repeat(2, 1fr); /* Default: 2 columns */ |
| 15 | + gap: 16px; |
| 16 | + width: 100%; |
| 17 | + max-width: var(--col); |
| 18 | + margin: 0 auto;; |
18 | 19 | } |
19 | 20 |
|
20 | 21 | header nav a { padding: 0 1rem; |
21 | 22 | color: var(--link); |
22 | | - |
23 | 23 | text-decoration: none; |
24 | | -text-align: center; |
25 | | - border-left: #000001 dashed 1px;} |
| 24 | + text-align: center; |
| 25 | + border-left: #000001 dashed 1px; |
| 26 | + white-space: nowrap; |
| 27 | + min-height: 2rem; |
| 28 | + |
| 29 | + display: flex; |
| 30 | + align-items: center; |
| 31 | + justify-content: center; |
| 32 | + white-space: nowrap; |
| 33 | + height: 2rm; /* Example height */ |
| 34 | + box-sizing: border-box; |
| 35 | +} |
| 36 | + |
| 37 | +header nav a:nth-child(2n){border-right: #000001 dashed 1px;} |
| 38 | + |
| 39 | +/* When the container is wide enough, switch to 4 columns */ |
| 40 | +@media (min-width: 768px) { |
| 41 | + header nav{ |
| 42 | + grid-template-columns: repeat(4, 1fr); |
| 43 | + } |
| 44 | + header nav a:nth-child(2n){border-right: none;} |
| 45 | + header nav a:last-child{border-right: #000001 dashed 1px;} |
| 46 | +} |
| 47 | + |
26 | 48 |
|
27 | | -header nav a:last-child{border-right: #000001 dashed 1px;} |
28 | 49 |
|
29 | 50 | main { |
30 | | - max-width: 760px; margin: 1rem auto; background: #fff; padding: 1rem; |
| 51 | + max-width: var(--col); margin: 1rem auto; background: #fff; padding: 1rem; |
31 | 52 | border-radius: 10px; |
32 | 53 | /* box-shadow: 0 2px 12px #0001; */ |
33 | 54 | } |
|
0 commit comments