Thursday, November 13, 2014

Popup DropDown Using jQuery.

I am using jQuery file in this example..

Ex :-)

<script type="text/javascript" src="jquery-1.11.1.min.js"></script>

<style type="text/css">

#container { background: #eee; margin: 20px; min-height: 300px; position: relative; }

#columns { position: absolute; top: 20px; left: 20px; padding: 8px; border-radius: 4px; border: 0px; background: #33b5e5; color: white; }

#selector { 
    position: absolute; 
    top: 60px; 
    left: 20px;
    background: #fff;
    border: 1px solid #999;
    border-radius: 5px;
    padding: 2px;
    font-size: 14px;
    color: #999;
    font-family: verdana;
    display: none;
}

#selector p{
margin: 5px;
}

</style>

<div id="container">
<button id="columns">Click on Me</button>
<div id="selector">
    <p><input type="checkbox"> MaHi</p>
    <p><input type="checkbox"> Sonal</p>    
    <p><input type="checkbox"> Aarti</p>
    <p><input type="checkbox"> Manisha</p>
</div>
</div>

<script type="text/javascript">

$(document).ready(function() {
    $('#columns').on('click', function() {
        $('#selector').fadeToggle(500);
    });
});

</script>


Output :)

1)

2)

Wednesday, November 12, 2014

Make two pictures overlap using CSS

<style type="text/css">

.container {
width: 550px;
height: 250px;
margin: 50px;
overflow:hidden;
position: relative;
border: 2px solid #666;
}

.img1 {
border-right: 2px solid #666;
position: absolute;
width: 325px;
height: 600px;
overflow: hidden;
left: -75px;
top: -230px;
z-index: 2;
-ms-transform: rotate(45deg); /* IE 9 */
-webkit-transform: rotate(45deg); /* Chrome, Safari, Opera */
transform: rotate(45deg);
}

.img1 img {
-ms-transform: rotate(-45deg); /* IE 9 */
-webkit-transform: rotate(-45deg); /* Chrome, Safari, Opera */
transform: rotate(-45deg);
}

.img2 {
position: absolute;
width: 450px;
left: 150px;
z-index: 1;
overflow: hidden;
}

</style>

<div class="container">
    <div class="img1"><img src="dubai evening rush.png" /></div>
    <div class="img2"><img src="dubai.jpg" /></div>
</div>


Output :)


Tuesday, November 11, 2014

Mask or clip of an image's shape using CSS

<style type="text/css">

.triangle{
border-radius: 50%;
width: 150px;
height: 150px;
margin: 50 auto;
transform: rotate(-45deg);
position: relative;
overflow:hidden;
border-radius: 0 50% 50% 50%;
}
.triangle img{
width: 200%;
height: 200%;
transform: rotate(45deg);
position: relative;
left: -90px;
top: -24px;
}

</style>

<body>
<div class="triangle">
 <img src="ganesha.jpg" />
</div>
</body>


Output :)


Sunday, November 9, 2014

Create triangle shaped pointer/border on a horizontal line.

<style type="text/css">

.box {
background: #33b5e5;
width: 500px;
height: 80px;
position: relative;
}

.line {
height: 39px;
border-bottom: 2px solid white;
}

.triangle {
background: #33b5e5;
border: 2px solid white;
border-width: 2px 2px 0 0;
transform: rotate(-45deg);
position: relative;
left: 250px;
top: 28px;
width: 20px;
height: 20px;
}

</style>

<div class="box">
<div class="line">
<div class="triangle"></div>
</div>
</div>


Output :)


Wednesday, October 29, 2014

How to make images responsive?

<style type="text/css">

 /*makes an image responsive*/
.responsive-image{
         
  display: block;
  height: auto;
  max-width:100%;
  width:100%;

}

</style>

<img class ='responsive-image' src =' http://www.google.com/images/srpr/logo11w.png'>

<!-- Now resize the browser to check whether its working or not -->


Output :)


Sunday, October 26, 2014

CSS : Multiline header background hover

<style type="text/css">

.container {
    width: 50px;
}

h1 > span {
    display: inline-block;
    position: relative;
}

h1 > span:before {
    content: "";
    display: block;
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: crimson;
    z-index: -1;
    -webkit-transition: height 0.25s;
    -moz-transition: height 0.25s;
    -ms-transition: height 0.25s;
    -o-transition: height 0.25s;
    transition: height 0.25s;
}

h1:hover > span:before {
    height: 100%;
}

</style>

<div class="container">
    <h1>
        <span>Hello</span> <span>World</span>
    </h1>
</div>


Output :)

1)

2)

Friday, October 24, 2014

How to give different href on single image ?

<style type="text/css">

.imgwrap {
   position:Relative;
}
.imgwrap a {
   position: absolute;
   text-indent: -9999px;
   border: 1px solid red;
   display: block;
   width: 134px;
   height: 70px;
   top: 143px;
   left: 395px;
}

</style>

<div class="imgwrap">

<a href="google.com"></a>

    <img src="image.png" />

</div>


Output :)