HTML5 Styles

I follow Ajaxian blog and they posted very interesting thing today. It turns out you can do very cool styling of your elements in new browser that I and most likely other developers might not be aware of.

I will borrow the code from their site:

<html> 
<head> 
<style>blah { color: red; }</style> 
<script>document.createElement("blah")</script> 
</head> 
<body> 
<blah>Hello!</blah> 
</body> 
</html>

Now, from article this code should work in IE, and it does, it produces red Hello. However, just out of curiosity I wanted to see if it might work in Firefox and Opera. I figured it will not work in Opera, so I started it first and surprise, surprise, it does. Then I tried Firefox and it works there as well.

I have to research this a little bit more to understand it better, but this looks cool to me. Since it works in current versions of major browser, it is good for me to use on my projects.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s