From 6689f72dfd82c9e375af0a87b86d228bf81ab85a Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Sun, 24 Mar 2013 03:03:46 -0700 Subject: [PATCH] first-child removes whitespace from top of posts MUST REMOVE SCRIPT METAMORPH FROM COOKED FOR THIS TO WORK! --- .../stylesheets/application/topic-post.css.scss | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/application/topic-post.css.scss b/app/assets/stylesheets/application/topic-post.css.scss index 644937221..bf0d102f3 100644 --- a/app/assets/stylesheets/application/topic-post.css.scss +++ b/app/assets/stylesheets/application/topic-post.css.scss @@ -539,9 +539,6 @@ background-color: $white; word-wrap: break-word; @include border-radius-top(4px); - p:nth-of-type(1) { - margin-top: 0; - } .calc { background-color: $highlight; margin-bottom: 10px; @@ -583,9 +580,17 @@ } } + .topic-body { position: relative; + // this removes the topmost margin; + // if we don't have this, all posts would have extra space at the top + .cooked > *:first-child { + margin-top: 0px !important; + } + + // set up proper header margins in posts h1, h2, h3, h4, h5, h6 { margin: 20px 0 10px; }