Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9002331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:33:24+00:00 2026-06-16T00:33:24+00:00

I am building a website theme for distribution and I just uploaded a unit

  • 0

I am building a website theme for distribution and I just uploaded a unit test to see how things looked. One of the things were nested blockquotes which in my case gave me a very large margin at the bottom. I was able to remedy this by styling

blockquote blockquote {
margin-bottom:0;
}

… so I solved that problem, but it brought out another … I realised that if someone was to add some content after the second blockquote then the margins would be out. I am sure I could style this but then what if someone was to put a header, pre, code etc in the same position? … and this scenario doesn’t just manifest itself in blockquote … or just in comments.

My question is this: when building themes for distribution do theme developers style for every single permutation and combination or is this even possible to do ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:33:24+00:00Added an answer on June 16, 2026 at 12:33 am

    In this particular instance, it sounds like you added a padding to the blockquote (probably it looks nicer if you also have a background color or border) and because blockquote has a margin-bottom on it by default, the padding-bottom and margin-bottom are adding together.

    My current favorite way of dealing with this is like so:

    Using Sass:

    p, blockquote, .other-margined-elements {
        margin: 1rem 0;
    
        &:first-child {
            margin-top: 0;
        }
    
        &:last-child {
            margin-bottom: 0;
        }
    }
    

    The generated CSS:

    p, blockquote, .other-margined-elements {
        margin: 1em 0;
    }
    
    p:first-child, blockquote:first-child, .other-margined-elements:first-child {
        margin-top: 0;
    }
    
    p:last-child, blockquote:last-child, .other-margined-elements:last-child {
        margin-bottom: 0;
    }
    

    With this method, it’s just a matter of figuring out which elements to add to the list. My current list is this: h1, h2, h3, h4, h5, h6, p, ul, ol, dl, table, blockquote, div, section, article, aside, fieldset

    There are other ways to do this if you feel the preceding code is a bit overboard:

    blockquote > :first-child {
        margin-top: 0;
    }
    
    blockquote > :last-child {
        margin-bottom: 0;
    }
    

    Thanks to the :first-child and :last-child psuedo classes, there’s no need to write out every single combination.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just building website for our client. It is simple page which lists
I am building a website which includes a full width slider; 100% of browser
I'm building a website with xhtml, css, jquery, php and mysql. In one of
I'm building a website on which tweets from a certain user should be displayed.
Im building a website with a jquery header that fades one picture into the
I am building a website specifically for mobile devices. There is one page in
I'm currently building a website .net/c#. I'm looking to see if there is a
I'm building a website and one of the requirements is for users to export
I'm building a website using rails 3.1, which at it's core consists of a
I'm building a website which allows the user to drag elements on to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.