We help IT Professionals succeed at work.

Apply Style to ASCII Characters

Mark Franz
Mark Franz asked
Medium Priority
Last Modified: 2012-06-22
I know all about :pseudo elements, but is there a way to assign properties to specific characters?  For example, lets say I want every copyright, (©       ©) to show up with a particular set of properties.

Simple?  Without applying <span> or <pre> or <font> to each and every symbol?
Watch Question

Top Expert 2011
Using just pure CSS, I don't think it's possible to target the actual characters. That's just like asking CSS to target the word "the" in a page.
Top Expert 2013
Considering the amount of bloat I have seen in some stylesheets It is a goo thing you can't target individual character; we'd probably end up digging through 5mb stylesheets that absolutely position every word and float the punctuation.

It is easy enough to just have a copyright class and apply it.  It is not like there hundreds of copyrights in a document.
Mark FranzProject Manager


While it is easy to use Regexp to go through and find all matches for a particular string, it will still require some sort of style class call to emphasis or highlight the character.  I will end up probably just wrapping everything in a <font> tag.

Maybe in CSS3.1 we can get more pseudo class items listed.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.