This is not possible using CSS.
You could use Javascript to check all characters in your text for uppercase (e.g. by using if (yourtext == yourtext.toUpperCase())
) and then wrap a <span>
around them containing your CSS to style these.
Or something around these lines:
function wrapCaps() {
var text = document.getElementById("my_text").value;
for(i=0; i < text.length; i++) {
if(text[i].charCodeAt(text[i]) >= 65 && text[i].charCodeAt(text[i]) <= 90)
wrapNode(text[i], 'span');
}
}
I didn't try it out (maybe somebody has the time to create a jsfiddle with this?), you might need to use replaceNode
or something like that. The charCodeAt
method just looks for uppercase letters, please note that no unicode characters like special greek uppercase letters will be included.
You now only need to style your span with something like:
#my_text span {
font-size: 10px;
}