Jump to content

content property?


That's Me

Recommended Posts

Hello. I'm curious, is there a "content" property in CSS?I was reading through an email digest I subscribe to and someone posted a CSS snippet with a content property. It looked like this:

code:before { content: " <?"; display:block; } code:after { content: " ?>"; display: block; }

Is this for real or am I dreaming? What does this do, exactly?Thanks.

Link to comment
Share on other sites

Yup, thats perfectly valid CSS. It defines generated content to be displayed before/after the current element. It can only be set within the :before and :after pseudo-elements for a real element. So your code there will work fine to put <? before the each code element and ?> after.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...