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 6587385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:54:38+00:00 2026-05-25T16:54:38+00:00

I implemented (a modified version of) Gene Locklin’s ‘depth’ which works just fine, here’s

  • 0

I implemented (a modified version of) Gene Locklin’s ‘depth’ which works just fine, here’s the code:

body:before {
    height: 10px;
    width: 110%;
    position: fixed;
    top: -10px;
    left: -10px;
    z-index: 6;
    -webkit-box-shadow: 0px 0px 10px rgba(0,0,0,0.8);
    -moz-box-shadow: 0px 0px 10px rgba(0,0,0,0.8);
    box-shadow: 0px 0px 10px rgba(0,0,0,0.8);
    content: "";
}

But I would like to use the :before & :after selectors to add margins or padding, you know some kind of gap, to separate a form from the surrounding text.

This comes after me trying to use these selectors to give some spacing around specific paragraphs, without success I turned to styling these on the basis of their target attributes.

I realize that the selectors were designed primarily to facilite auto-text and that it’s perfectly easy to do this with margins or padding (added following queries below),line breaks, spans, an empty division, or even using JavaScript to create an element, and . But I would like to do this with :before & :after.

Here’s the example code that I would like to get working:

form:before {
    height: 20px;
    content: "";
}

form:after {
    height: 20px;
    content: "";
    }

Possibilities I think may be preventing this from working… :before/:after need to be displayed as block-level as they are normally inline (but the ‘depth’ doesn’t need this?) and/or :before/:after require absolute positioning.

Thank you in advance for your generous input.

  • 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-05-25T16:54:38+00:00Added an answer on May 25, 2026 at 4:54 pm

    Try specifying display: block;. They don’t need to be position: absolute;.

    form:after {
      content: ' ';
      display: block;
      height: 20px;
    }
    
    form:before {
      content: ' ';
      display: block;
      height: 20px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a modified version php-sdk version 3.0.0 sample code at github.com/facebook within
Having implemented CLogClass to make decent logging I also defined macro, but it works
I used a slightly modified version of Ryan Scherf's jQuery swipe plugin on a
I am trying to implement table with users' accounts, which can be modified by
I implemented a Zend project And its working fine Now i tried to implement
I want Lucene.NET to store a value while indexing a modified, stripped-down version of
Hi looking at the repository pattern which commonly seems to be implemented something like:
The code posted here is 'example' code, it's not production code. I've done this
I am trying to implement a modified parallel depth-first search algorithm in Erlang (let's
I have modified the login in and implemented this instead. public void login() {

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.