Tech blog

PHP tutorials,a way to getting some thing new in web

Followers

Powered by Blogger.

Tuesday 7 April 2015

Box Animation Effect using CSS

No comments :
Hi friends,Today i am posting here a topic which is not part of programming.I have created one simple animation effect using HTML5 and CSS3.Many of you have tried it by your own.You may find it useful because this code is so simple.

CSS

h1:hover{

    /* Rotate div */
    -ms-transform: rotate(360deg); /* IE 9 */
    -webkit-transform: rotate(360deg); /* Chrome, Safari, Opera */
    transform: rotate(360deg);
-webkit-animation:spin1 4s linear infinite;
    -moz-animation:spin1 4s linear infinite;
    animation:spin1 4s linear infinite;

}
h1{
   /* Rotate div */
    width: 50%;
    height: 20%;
    background-color: yellow;
    -ms-transform: rotateY(180deg); /* IE 9 */
    -webkit-transform: rotateY(180deg); /* Chrome, Safari, Opera */
    transform: rotateY(180deg);
-webkit-animation:spin 4s linear infinite;
    -moz-animation:spin 4s linear infinite;
    animation:spin 4s linear infinite;
}
img:hover {
        -moz-transform: scaleX(-1);
        -o-transform: scaleX(-1);
        -webkit-transform: scaleX(-1);
        transform: scaleX(-1);
        filter: FlipH;
        -ms-filter: "FlipH";

}
img
{
-webkit-animation:spin 4s linear infinite;
-moz-animation:spin 4s linear infinite;
animation:spin 4s linear infinite;
}
img:hover
{
-webkit-animation:spin1 4s linear infinite;
-moz-animation:spin1 4s linear infinite;
animation:spin1 4s linear infinite;
}
@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }

@-moz-keyframes spin1 { 100% { -moz-transform: rotate(360deg);font-size: 10px;} }
@-webkit-keyframes spin1 { 100% { -webkit-transform: rotate(360deg); font-size: 10px; } }
@keyframes spin1 { 100% { -webkit-transform: rotate(360deg); font-size: 10px; } }

HTML

Lets see how whole code will do.

<html>
<head>
<title>Text Effect</title>
<style>
h1:hover{

    /* Rotate div */
    -ms-transform: rotate(360deg); /* IE 9 */
    -webkit-transform: rotate(360deg); /* Chrome, Safari, Opera */
    transform: rotate(360deg);
-webkit-animation:spin1 4s linear infinite;
    -moz-animation:spin1 4s linear infinite;
    animation:spin1 4s linear infinite;

}
h1{
   /* Rotate div */
    width: 50%;
    height: 20%;
    background-color: yellow;
    -ms-transform: rotateY(180deg); /* IE 9 */
    -webkit-transform: rotateY(180deg); /* Chrome, Safari, Opera */
    transform: rotateY(180deg);
-webkit-animation:spin 4s linear infinite;
    -moz-animation:spin 4s linear infinite;
    animation:spin 4s linear infinite;
}
img:hover {
        -moz-transform: scaleX(-1);
        -o-transform: scaleX(-1);
        -webkit-transform: scaleX(-1);
        transform: scaleX(-1);
        filter: FlipH;
        -ms-filter: "FlipH";

}
img
{
-webkit-animation:spin 4s linear infinite;
-moz-animation:spin 4s linear infinite;
animation:spin 4s linear infinite;
}
img:hover
{
-webkit-animation:spin1 4s linear infinite;
-moz-animation:spin1 4s linear infinite;
animation:spin1 4s linear infinite;
}
@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }

@-moz-keyframes spin1 { 100% { -moz-transform: rotate(360deg);font-size: 10px;} }
@-webkit-keyframes spin1 { 100% { -webkit-transform: rotate(360deg); font-size: 10px; } }
@keyframes spin1 { 100% { -webkit-transform: rotate(360deg); font-size: 10px; } }
</style>
</head>
<body>
<h1>This is<br/>Image Animation of Box</h1><br/><br/>
<img src="e:\2.jpg" alt="flipped" border="0"/>

</body>
store file with whatevername.html and run in browser.change image path with your image path in img tag.


Friday 3 April 2015

Sticky Header using HTML5 and CSS3

No comments :
Hi friends,Today i am posting here a topic which is not part of programming.I have created one simple sticky header using HTML5 and CSS3.Many of you have tried it by your own.You may find it useful because this code is so simple.




CSS

body{
    margin:0px;
    background:#000;
}
.header-cont {
  position: fixed;
  width: 100%;
  text-align: center;
  font-size: 72px;
  height: 204px;
  background: #335C7D;
  color: #fff;
  font-family: 'PT Sans', sans-serif;
}
.header {
    height:50px;
    background:#F0F0F0;
    border:1px solid #CCC;
    width:960px;
    margin:0px auto;
}
.content {
    width:960px;
    background: #CCC;
    border: 1px solid #CCC;
    height: 2000px;
    margin: 70px auto;
}
.ul
{
width:100%;
list-style-type:none;
}
.ul li
{
display:inline-block;
list-style-type:none;

}

First of write simple css for page in which we will make three part.Header,content and menu.this is for study so i m trying make it as simple as i can.


HTML

Lets see how whole code will do.

<html>
<head>
<style type="text/css">
body{
    margin:0px;
    background:#000;
}
.header-cont {
  position: fixed;
  width: 100%;
  text-align: center;
  font-size: 72px;
  height: 204px;
  background: #335C7D;
  color: #fff;
  font-family: 'PT Sans', sans-serif;
}
(this is css for sticky header.sticky header will work when we use position:fixed).just define this and header will take effect of sticky header.
.header {
    height:50px;
    background:#F0F0F0;
    border:1px solid #CCC;
    width:960px;
    margin:0px auto;
}
.content {
    width:960px;
    background: #CCC;
    border: 1px solid #CCC;
    height: 2000px;
    margin: 70px auto;
}
.ul
{
width:100%;
list-style-type:none;
}
.ul li
{
display:inline-block;
list-style-type:none;
}
</style>
</head>
<body>
<div class="header-cont">
<h5>This is Sticky header demo by Ruchi Sanghvi</h5>
    <div></div>
</div>
(this is portion for sticky header)

<div class="content">
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.

Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
</div>
</body>
</html>


happy coding!!