-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructure.css
More file actions
57 lines (46 loc) · 1.72 KB
/
structure.css
File metadata and controls
57 lines (46 loc) · 1.72 KB
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
47
48
49
50
51
52
53
54
55
56
57
/*
CSS stylesheet to highlight the structure of an HTML document.
Copyright 2012 Antonio Bonifati
If you find this style sheet useful while developing your layouts,
please consider making a little personal donation via Paypal.
Just visit my blog at http://antonio-bonifati.blogspot.com and click
the Donate button. Every little helps to finance my studies! Grazie!
*/
/*
Style some block-level elements that define the overall structure. Please let
me know if a structural tag you would like to always be highlighted is missing!
*/
address, article, aside, body, canvas, div, footer, form, header, hgroup, nav,
map, object, section, table, tfoot tr td, th, thead tr td {
border: thin dashed;
margin: 1%;
counter-reset: depth;
}
body { counter-reset: depth; }
/* Display the tag name to make some block level elements more visible.
I could get a tag nesting level as a string like 1+1+1 for 3, by using CSS
counters, but there is no way in CSS to evaluate this string and turn it
into a color code. I'm missing an eval function in CSS!
:before { ... counter-increment: depth; ... }
address:before { ... counters(depth, "+") ... }
So to colorize boxes I am forced to use JavaScript :(
*/
:before {
text-align: center;
display: block;
font-style: normal;
}
address:before { content:"address" }
article:before { content:"article" }
aside:before { content:"aside" }
body:before { content:"body" }
canvas:before { content:"canvas" }
div:before { content:"div" }
footer:before { content:"footer" }
form:before { content:"form" }
header:before { content:"header" }
hgroup:before { content:"hgroup" }
nav:before { content:"nav" }
map:before { content:"map" }
object:before { content:"map" }
section:before { content:"section" }