From 2b0a47ebbaaa03537540371e6151f9c649fd90d1 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Mon, 26 Feb 2018 18:35:30 +0100 Subject: CSS: Chapter numerotation --- static/css/main.css | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/static/css/main.css b/static/css/main.css index 6d46521..6ff94be 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -4,11 +4,19 @@ a:active, a:link, a:visited, a:hover { text-decoration: none; } -h1, h2, h3, h4, h5, h6 { +h1 { text-align: left; color: #e52c5a; } +h2 { + margin-left: 7px; +} + +h3, h4, h5, h6 { + margin-left: 15px; +} + h1#site_title { text-align: center; color: black; @@ -112,6 +120,31 @@ div.normal { background-image: url("/img/note.png"); } +/* CSS counter for chapters/sections */ +body { + counter-reset: chapter; +} + +h2:before { + counter-increment: chapter; + content: counter(chapter) ". "; +} + +h1 { + counter-reset: chapter; +} + +h2 { + counter-reset: section; +} + +h3:before { + counter-increment: section; + content: counter(chapter) "." counter(section) " "; + +} + +/* For big displays/screens */ @media (min-width: 960px) { html, body { width: 960px; -- cgit v1.2.3