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

  • Home
  • SEARCH
  • 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 7946511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:10:22+00:00 2026-06-04T01:10:22+00:00

While looking for a solution to this question , I attempted to add a

  • 0

While looking for a solution to this question, I attempted to add a clearing element with the :after pseudo-class. It did what I want, but not for the reason I expected – after narrowing things down I found out that defining the following clears the elements:

.right_field > div:after
{
    content: "style=\"foo\"";
}

What I would expect it to do is append the text style="foo" to the end of the div elements inside the .right_field, but instead it adds nothing visual and clears the elements so that they wrap around their floating children.

See the following fiddle for a demonstration. Try removing the foo from inside the content property and see how it no longer clears the element and instead just appends the text to each of them.
http://jsfiddle.net/dNJxd/5/

Why does this happen, and is this a feature that can be counted on? I tested it on Chrome, Firefox and IE7-9 and they all worked the same way.

  • 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-04T01:10:24+00:00Added an answer on June 4, 2026 at 1:10 am

    Your example does append the text style="foo" after the div element. The only browser that wouldn’t do this (from your list of tested browsers) is IE7 because it does not support the ::after pseudo class.

    Maybe you need to stretch out your JSFiddle result window a little further.

    Also, this does not clear the float – it just gives the parent div some height since the appended text is not floated. The border collapse will still occur when the content of the div has a larger height than the appended text.

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

Sidebar

Related Questions

While looking up the answer to this question: Why is an out parameter not
While looking at some conceptual questions in C,I came across this question in a
I have been looking for a solution to this problem for a while now
The same question is answered in jQUery but I'm looking for solution without jQuery.
I remember asking this question a while back but i can't seem to find
After looking a while other google, and the web, I decided to post my
Possible Duplicate: Class construction with initial values While I was looking at c++ example
This question is an attempt to find a practical solution for this question .
Referring on this question , I have a similar -but not the same- problem..
A while ago I asked this question: using xslt stylesheet to convert xhtml blank

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.