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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:06:02+00:00 2026-05-31T08:06:02+00:00

I got http://jsfiddle.net/8p2Wx/2/ from a previous question I asked and I see these lines:

  • 0

I got http://jsfiddle.net/8p2Wx/2/ from a previous question I asked and I see these lines:

.cf:before,
.cf:after {
    content:"";
    display:table;
}

.cf:after {
    clear:both;
}

If I take away content:"", it ruins the effect, and I don’t understand why it’s necessary.

Why is it needed to add an empty content to :after and :before pseudo-elements?

  • 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-31T08:06:04+00:00Added an answer on May 31, 2026 at 8:06 am

    You cannot style generated content without defining what that content should be. If you don’t really need any content, just an extra “invisible element” to style, you can set it to the empty string (content: '') and just style that.

    It’s easy to confirm this yourself: http://jsfiddle.net/mathias/YRm5V/

    By the way, the snippet you posted is the micro clearfix hack, which is explained here: http://nicolasgallagher.com/micro-clearfix-hack/

    As for your second question, you’ll need an HTML5 shiv (small piece of JavaScript) to make <nav> stylable in some older browsers.

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

Sidebar

Related Questions

I got a CSS question related to this fiddle: http://jsfiddle.net/r584e/ Here the relevant screenshot
Example here: http://jsfiddle.net/7h2Dh/ Got this html: <span>Text<div id=wtf>Content</div>Text</span> I need to set div display
I have got an example here: http://jsfiddle.net/cByhZ/ As you can see the buttons value
I've got the following code (which you can see in play at http://jsfiddle.net/5dbZx/ ).
I've got a toggle menu, please see http://jsfiddle.net/Wp2em/41/ for code and functions. On the
This is what I've got actually: http://jsfiddle.net/downloadtaky/P7jYU/ What I would like to achieve is
I've got an angled CSS gradient at http://jsfiddle.net/jeepstone/GLcRe/ In Firefox this is fine, but
Please check out this http://jsfiddle.net/karthik64/JHVDn/1/ . Well I believe you got where I am
Here you can see the code: http://jsfiddle.net/LQSK3/1/ I can't get display: inline; working there
Here is the recreation of my problem http://jsfiddle.net/WsFyV/7/ Select any option from the first

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.