create sticky footer using css or javascript

You can create sticky footer using css perfectly. Use following css code for creating the sticky footer. Many people gave example of google sticky footer.

create sticky footer using css or javascript

create sticky footer using css or javascript
create sticky footer using css or javascript

Use bellow CSS code.


html{

height:100%

}

body{

height:100%

}

#footer{

position: relative;

bottom: 0px;

height: 100px;  //You must need to know your footer height

margin-bottom:-100px; //here I am thinking footer will be 100 px

}

You can change the footer height as per your need or footer height.

Sticky footer you will also achieve using javscript code.

<script>// <![CDATA[

// ]]></script>
document.body.onload = function () {
 var myWidth = 0, myHeight = 0;
 if( typeof( window.innerWidth ) == 'number' ) {
 //Non-IE
 myWidth = window.innerWidth;
 myHeight = window.innerHeight;
 } else if( document.documentElement &&
 ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
 //IE 6+ in 'standards compliant mode'
 myWidth = document.documentElement.clientWidth;
 myHeight = document.documentElement.clientHeight;
 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
 //IE 4 compatible
 myWidth = document.body.clientWidth;
 myHeight = document.body.clientHeight;
 }
 window.alert( 'Width = ' + myWidth );
 window.alert( 'Height = ' + myHeight );

 middle_container = myWidth - 150; // here I am thinking footer and header hight is 150px
 document.getElelmentByID("main").style.height = middle_container;
}
// ]]>

You just need to minus the header and footer height from middle_container.

change image of on MouseOver Event using JavaScript

Using only javascript and CSS you can easily achieve mouseover effect. In article we given sample code for change image of on MouseOver Event in your site.

change image of on MouseOver Event using JavaScript or CSS

change image of on MouseOver Event using JavaScript or CSS
change image of on MouseOver Event using JavaScript or CSS

If you want to change the image on rollover or mouseover event. This is very old technique. You can achieve this using CSS or javascript. I given the simple and powerful code javascript mouse event. I tested this code. It works on all the browsers.

With CSS you can use the following code:


.yourimage { background-image: url('firstImage.jpeg'); }
.yourimage:hover { background-image: url('secondImage.jpeg'); }

<div class=”yourimage” style=”height:100px;width:100px;min-height:100px;min-width:100px;”></div>

I am using the yourimage class for div element.

With javascript you can use following code

<div>
<img src="firstimage.jpeg" onmouseover="this.src='secondimage.jpeg'" onmouseout="this.src='firstimage.jpeg'"/>

If you are using the Jquery then use following code:

<style>
.imagediv{background-image:firstimage.jpg}
<div class="imagediv"/>

 $(document).ready(function () {
            $('div.imagediv').mouseover(function () {
                $(this).css(background-image", "url('secondimage.jpg')");
            });
        });

How to write inline conditional css

We all know what is conditional css and how to write the conditional css. We have written CSS tutorial for writing  inline conditional css easily.

write inline conditional css

Here is few examples about conditional css.

write inline conditional css
write inline conditional css

[css-hacks]

With in style.css file

 a.button_active, a.button_unactive {
 display: inline-block;
 [if lte Gecko 1.8] display: -moz-inline-stack;
 [if lte Konq 3.1] float: left;
 height: 30px;
 [if IE 5.0] margin-top: -1px;
 text-decoration: none;
 outline: none;
 [if IE] text-decoration: expression(hideFocus='true');
 }

When we are use the inline css in document. If in that case we need to use conditional css then there is way

// Following is hack for all IE, including 7. It must go first, or it overrides the following hack
<div style=&quot;width:15px;^width:13px;&quot;>
some dynamic content
</div>
// Following is hack for all IE6 + browsers
<div style=&quot;width:15px;_width:14px;&quot;>
some dynamic content
</div>

How to use word wrap with css

Many times we need to do word wrap using languages. I recommend use css for word wrapping. In this article, we explained about How to use word wrap with css

How to use word wrap with css

You can force long (unbroken) text to wrap in a new line by specifying break-word with the word-wrap property.
This is a problem with CSS layouts that use floated divs.

use word wrap with css
use word wrap with css

Use following code for fix the word wrap with all divs.

div { word-wrap: break-word }

instead of this we always use following css code:

overflow:hidden;

But this is not good practice. Use word-wrap css property.
Word-wrap is supported in IE 5.5+, Firefox 3.5+, and WebKit browsers such as Chrome and Safari.

Best IDE for WordPress, Drupal Plugin and Theme development

Many developer who are experienced in development. But with another CMS development. we look for Best IDE for WordPress, Drupal Plugin and Theme development.  But still that comes to another cms or project development. We are always search for good IDE which are free and open source that is the first requirement.

Best IDE for WordPress, Drupal Plugin and Theme development

Our basic need are as follows in any IDE, the IDE need to support following things:

  • CSS
  • XHTML/HTML
  • JavaScript
  • PHP
  • MySQL

I created a list of IDE which I used daily  to do a development. Here I need to clarify IDE is language specific. I work in PHP, Ruby on Rails, Adobe Air, Flex, Javascript, CSS.

I recommend following IDEs which I really found useful for all the developer who are working in wordpress, joomla, drupal development.

1. eclipse (Compatible  on Windows and Linux)

Best IDEs for WordPress, Joomla, Drupal Plugin and Theme development
Best IDE for WordPress, Drupal

Description: Eclipse is best IDE for all language development. Eclipse IdE is basically Java development but still that provides PHP, ROR and other language support. I like this IDE for java development but I did not recommend for PHP or Ruby on Rails.

2. NetBeans (Compatible  on Windows and Linux)

Best IDEs for WordPress, Joomla, Drupal Plugin and Theme development
Best IDE for WordPress, Drupal

Description: This IDE has also all language support. I specially like this IDE from Ruby on Rails development. I Used this IDE for Ruby on Rails development as well as some times for PHP development. Among the Ruby on Rails developer this IDE is so popular.

3. Komodo (Compatible  on Windows and Linux)

Best IDE for WordPress, Drupal
Best IDE for WordPress, Drupal

Description : This IDE is also support for all languages. This IDE is really good support for PHP. I really love this IDE for PHP development. Simple and fast and still nice features about PHP. This IDE is really popular among the PHP developers.

4. Aptana (Compatible  on Windows and Linux)

Best IDE for WordPress, Drupal
Best IDE for WordPress, Drupal

Description : This IDE is mainly made for Ruby on Rails development. This is also popular among Ruby developers. This IDE has features like eclipse. I like this IDE for Adobe Air and flex development.  This IDE has also PHP support.

5. EditPlus (Compatible  on Windows)

Best IDE for WordPress, Drupal
Best IDE for WordPress, Drupal

Description: This IDE is plain simple text editor. Shows you simple color highlight features. I specially recommend this IDE for PHP development and new PHP developer always start with this IDE so they will get filmier with PHP functions and methods because this IDE is does not provide any help. I love the use this IDE in daily use for any language development.

If you want to add any more IDEs. You can comments on this article.

footer stickable to end of the browser window without fixed position

Many web developer always think about why footer is not sticking to end of browser. In this tutorial we will show you to footer stickable to end of browser.

This is scenario:
If content is less than footer need to go bottom of browser and if content is more than footer will go down as per content.

Many people think this is CSS developer’s But I am not think that way. because this is totally different problem.

Some people suggest to use header, middle container and footer height in percentage. But that is wont be possible for all the time.

Here I will give you the solution. Use following JavaScript in document.

<script type="text/javascript">
 var header_height = 150;
 var footer_height = 100;
var reduce_height = header_height+footer_height;
 browserHeight = 0;
 if( typeof( window.innerHeight ) == 'number' ) {
 //Non-IE
 browserHeight = window.innerHeight;
 } else if( document.documentElement &amp;&amp; (  document.documentElement.clientHeight ) ) {
 //IE 6+ in 'standards compliant mode'
 browserHeight = document.documentElement.clientHeight;
 } else if( document.body &amp;&amp; (  document.body.clientHeight ) ) {
 //IE 4 compatible
 browserHeight = document.body.clientHeight;
 }
 // window.alert( 'Height = ' + browserHeight );
 var min_height = browserHeight-reduce_height+ +"px"
 document.write('<style>#middle_container{min-height:'+ min_height +'}</style>');
 //document.getElementById("middle_container").style.minHeight = browserHeight-146+"px";
</script>

Here in this JavaScript I am assuming middle_container is your main block of content. You can change the variables as per your need.

footer stickable to end
footer stickable to end

Create fixed side or top buttons in wordpress theme

We can easily introduce fixed side buttons in wordpress or any website. In this article I given code snippet for Create fixed side buttons in wordpress.

Create fixed side buttons in wordpress

Fixing the position of any document element using CSS this is very old technique but still  I am going to give you some good trick to show the twitter button or search buttons or add new button on bottom or sidebar.

Using following CSS code you can integrate the any button on sidebar.


#submit_news { background:transparent url(images/submit-news.png) no-repeat scroll 0px 0px; height:170px; left:0; position:fixed; top:180px; width:40px; }
div#submit_news:hover { background-position:-41px 0px; }
#submit_news a{ display:block; height:170px; width:40px; }

In this tutorial we are using the only one image as a button. As we know we are using the sprite image css here.

Open your header.php file from wordpres theme. and under body tag put following code.

<div id=”submit_news”><a href=”/submit-news” ></a></div>

First you need to create the submit news page in wordpress.

If you want to add the submit news button for your site you can download from here.

Advanced rounded corner with only css

CSS tutorial, Advanced rounded corner with only css. I got so many scripts which had solution with javascripts and some are given solutions with images.

In one of my project I got requirement about half rounded corner in header and footer.

Advanced rounded corner with only css

But I want customize every thing like color of rounded corner header background, footer background and border also.

I did so much R&D about same but did not found any solution.

So I tried to code myself in CSS and I got succeed in that.
In this article I am going to share the code with you.

first put my style sheet in your webpage.

<style type="text/css">
body {background-color: #fff;font: normal 10pt ,Arial,sans-serif;}

img{border:none;}

.wordpressapi-main{
 clear:both;
 float:left;
 width:300px;
 /*border:1px solid #f00;*/
}

.wordpressapi_round_header {
 background-color: #ddd;

 -moz-border-radius: 15px 15px 0px 0px;
 -webkit-border-radius: 15px 15px 0px 0px;
 border-radius: 15px 15px 0px 0px;
 /*behavior: url(border-radius.htc);*/
 text-align:center;
 padding:5px 0px 5px 0px;
 clear:both;
 float:left;
}

.wordpressapi_round_footer {
 background-color: #ddd;

 -moz-border-radius: 0px 0px 15px 15px;
 -webkit-border-radius: 0px 0px 15px 15px;
 border-radius: 0px 0px 15px 15px;

 /*behavior: url(border-radius.htc);*/
 text-align:right;

 clear:both;
 float:left;

}
.wordpressapi_round_middle {
 text-align:center;
 color:blue;
 clear:both;
 float:left;
}
.inner_ad {
 padding:10px;
 text-align:left;
 color:black;
 font-size:12px;
 vertical-align: middle;

}
.round_heading{
font-size:16px;
line-height:26px;
font-weight:bold;

}

/* rounded corners */
.wordpressapi-blue-round-container{ /*margin-top:10px;*/}
.wordpressapi-blue-round-container-top, .wordpressapi-blue-round-container-bot, .wordpressapi-acco-top, .wordpressapi-acco-bot {
 display:block;
 background:#fff;
 font-size:1px;
 clear:both;

}
.blue-round-t1, .blue-round-t2, .blue-round-t3, .blue-round-t4 {display:block; overflow:hidden;}
.blue-round-t1, .blue-round-t2, .blue-round-t3 {height:1px;}
.blue-round-t2, .blue-round-t3, .blue-round-t4 {
 background:#0000FF;
 border-left:1px solid #ccc;
 border-right:1px solid #ccc;
}
.blue-round-t1 {
 margin:0 5px;
 background:#0000FF;
 border-top:1px solid #ccc;
 height:0px;
}
.blue-round-t2 {margin:0 3px; border-width:0 2px;}
.blue-round-t3 {margin:0 2px;}
.blue-round-t4 {height:2px; margin:0 1px;}

.white-round-t1, .white-round-t2, .white-round-t3, .white-round-t4 {display:block; overflow:hidden;}
.white-round-t1, .white-round-t2, .white-round-t3 {height:1px;}
.white-round-t2, .white-round-t3, .white-round-t4 {
 background:#FFF;
 border-left:1px solid #ccc;
 border-right:1px solid #ccc;
}
.white-round-t1 {
 margin:0 5px;
 background:#FFF;
 border-top:1px solid #ccc;
 height:0px;
}
.white-round-t2 {margin:0 3px; border-width:0 2px;}
.white-round-t3 {margin:0 2px;}
.white-round-t4 {height:2px; margin:0 1px;}

.wordpressapi-blue-round-contents{
 display:block;
 border:1px solid #000;
 border-width:0 1px;
 padding: 0 15px;
 background:#0000FF;
 color:#000;
 text-align:justify;
 width: 878px;
 clear:both;
 float:left;

}

.hold{
 border-left:1px solid #ccc;
 border-right:1px solid #ccc;
 clear:both;
 float:left;
 width:298px;
}

.inner-adds-bottom{
 padding-top:1px;
 clear:both;
 float:left;
}

/* rounded corners */

.cross-img, .cross-img:link, .cross-img:hover{
 background:url(close_button.gif) no-repeat center;
 width:12px;
 height:12px;
 display:inline-block;
}

.info-img, .info-img:link, .info-img:hover{
 background:url(information_btn.gif) no-repeat center;
 width:12px;
 height:12px;
 display:inline-block;
}
</style>

Then Put following code in your HTML body.

Advanced rounded corner with only css
Advanced rounded corner with only css

You will get the following result as follows:

Download the main html file from  here: Advanced rounded corner with CSS

how to create rounded corners using css

CSS tutorial, how to create rounded corners using css. We always need the rounded corners for our various web projects. W3C has offered borders in CSS3.

W3C has offered some new options for borders in CSS3, of which one is border-radius. Both Mozila/Firefox and Safari 3 have implemented this function.

how to create rounded corners using css

There are many javascripts are available to create the rounded corner using scripts. But specially recommend use pur css to avoid unnecessary script loading. So many sites uses the background image also, We need to avoid that also.

Following css will give you the rounded corners using only css:

.main_container {background:#ccc; color:#fff; margin:0 15px;}
.wordpressapitop, .wordpressapibottom{
display:block;
background:#fff;
}
.wordpressapitop *, .wordpressapibottom *{
display: block;
height: 1px;
overflow: hidden;
background:#ccc;
}
.wordpressapi1{margin: 0 5px}
.wordpressapi2{margin: 0 3px}
.wordpressapi3{margin: 0 2px}
.wordpressapi4{
margin: 0 1px;
height: 2px
}

Use following code in your html file and you are able to use rounded corners without using the javascript

round-code

How to create rounded corner using css
How to create rounded corner using css

Above script will work on all browsers FF, Chrome, Safari, IE6, IE7, IE8.

How to set Media Icons in wordpress theme

Just put some jpg, png or gif files in your theme images folder. In this article we shown to set Media Icons in wordpress theme.

set Media Icons in wordpress theme

  1. your_theme/images/audio.jpg
  2. your_theme/images/audio.gif
  3. your_theme/images/audio.png
  4. your_theme/images/mpeg.jpg
  5. your_theme/images/mpeg.gif
  6. your_theme/images/mpeg.png
  7. your_theme/images/audio_mpeg.jpg
  8. your_theme/images/audio_mpeg.gif
  9. your_theme/images/audio_mpeg.png

Whenever you are putting the media files in post above icons will appear in your theme.