Wednesday, 19 March 2014

css vertical text

CSS

.vertical-text {
-ms-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
-ms-transform-origin: left top 0;
-moz-transform-origin: left top 0;
-webkit-transform-origin: left top 0;
transform-origin: left top 0;
background: #E23737;
color: #fff;
margin-left: 40px;
padding: 10px;
border: 1px solid #ccc;
text-transform: uppercase;
border: 1px solid #B52C2C;
text-transform: 1px 1px 0px rgba(0, 0, 0, 0.5);
box-shadow: 2px -2px 0px rgba(0, 0, 0, 0.1);
float: left;
}

HTML

<div class="verticle-text">pranaysonisoft.blogspot.com</div>

Monday, 10 March 2014

jquery create elements on the fly

$("<div/>",{
    "class" : "someelement",
    // .. you can go on and add properties
    "css" : {
        "color" : "red"
    },
    "click" : function(){
        alert("you just clicked me!!");
    },
    "data" : {
       "foo" : "bar"
    }
}).appendTo("#container");
create div and set id ,class,css ,event on the fly
This is the way to go if youre setting multiple properties. Much cleaner than passing in a long string.
I would like to have feedback from my blog readers. 
Your valuable feedback, question, or comments about this article 
are always welcome.