That's Me Posted February 23, 2006 Share Posted February 23, 2006 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 More sharing options...
pulpfiction Posted February 23, 2006 Share Posted February 23, 2006 Check out this link http://www.w3schools.com/css/pr_gen_content.asp Link to comment Share on other sites More sharing options...
Pollux Posted February 23, 2006 Share Posted February 23, 2006 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 More sharing options...
That's Me Posted February 23, 2006 Author Share Posted February 23, 2006 Wicked! Does this work in all browsers? Link to comment Share on other sites More sharing options...
newbman Posted February 25, 2006 Share Posted February 25, 2006 Nope, before and after don't work in IE. Isn't that a coincidence? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now