Text rotation can be done by CSS3 3D Transforms. But after the transform the text is aliased. For WebKit browser, the anti-aliasing feature could be enabled by adding the following CSS style.
* { -webkit-transform: translate3d(0,0,0); }
Text rotation can be done by CSS3 3D Transforms. But after the transform the text is aliased. For WebKit browser, the anti-aliasing feature could be enabled by adding the following CSS style.
* { -webkit-transform: translate3d(0,0,0); }
Next: CSS3 – Smooth the text in WebKit browser after Text Rotation by activating the anti-aliasing
We can rotate text by using the CSS3 transform.
To rotate a text in clockwise direction with 45 degree:
p { -webkit-transform: rotate(45deg); /* Safari and Chrome */ -moz-transform: rotate(45deg); /* Firefox */ -ms-transform: rotate(45deg); /* IE 9 */ -o-transform: rotate(45deg); /* Opera */ transform:rotate(7deg); }
Next: HTML5 – Play sound/music with <audio> tag @ 2
With HTML5, we can easily play audio file with the <audio> tag. Here is an example.
<html> <head></head> <body> <audio controls loop autoplay> <source src="music.ogg" type="audio/ogg" /> <source src="music.mp3" type="audio/mp3" /> Your browser does not support the audio element. </audio> </body> </html>
Continue reading HTML5 – Play sound/music with <audio> tag @ 1
Here is an example which styles an HTML a link with a rounded corner button background.
Continue reading CSS3 – Rounded corner button background
I am learning Dojo by following the tutorials @ the Dojo official website. You can find all the tutorials @ the Dojo Documentation page.
In the first tutorial, it guides you to load the Dojo library from the CDN and add write your custom module. Normally, the module code should be placed relative to the dojo.js directory. But if we load the dojo.js from CDN, where should we put the our own code?
In that case, we have to configure the Dojo settings before we load the dojo.js. Here is an example.
Continue reading Dojo – Write your own Dojo module
The toSource() function, which we talk about yesterday(Javascript – Print an object with alert()), only works in Firefox, a more proper way which work in non Gecko engine browser like Chrome and Safari is using console. Continue reading Javascript – Print an object in console
I found a Javascript which is for adding bookmark to browser. Since Chrome and Safari do not support adding bookmark by Javascript, an alert box will be prompted and tell the user using Ctrl + D to add the bookmark instead. Continue reading Javascript – Add To Bookmark
It is very common to extract part of a string in computer programming and there is no exception in Javascript. Here are 2 functions for string extraction
Continue reading Javascript – Negative substr() problem in Internet Explorer
In Chrome, you can set the user agent to iPad such that the web server will return the view which is shown in iPad. Just add the user-agent parameter
1. Right click the Chrome shortcut on desktop and select property Continue reading Chrome – Set iPad as User Agent