Archive for April 2009
On mouseover Image change
Posted April 28, 2009
on:Here is an example how we can change the image on mouse over.
<a href=”#” onmouseover=”document.btn1.src=’images/img1.jpg'” onmouseout=”document.btn1.src=’images/img2.jpg'”><img src=”images/img2.jpg” alt=”” border=”0″ name=”btn1″/></a>
Here in this example I have used onmouseover one image and onmouseout another image. You can see the name parameter for the img tag. Using this tag I am changing the image that is document.name.src
This is one way another way would be to write a separate javascript for this an call the function on mouse over and onmousedown event.
How to make div position fixed
Posted April 27, 2009
on:- In: CSS
- Leave a Comment
Most of us might have seen to make any div position fixed we normally use css attribute as position:fixed, but this doesn’t work with IE as ususal the crap browser. So to make it compatible with IE here is a solution where we can make the div position fixed. Just copy the below code and try on your system.
HTML Code put this within Body section
<div id=”main”>
<div id=”main1″>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div id=”main2″>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id enim eu mauris condimentum pharetra. Praesent hendrerit, odio non condimentum cursus, Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>
And CSS code put this within Head Section
<style type=”text/css”>
*{ margin:0px; padding:0px; }
#main{ width:900px; text-align:left; clear:both; border:1px solid #999999; }
#main1{ width:900px; border-bottom:1px solid #999999; position:fixed; z-index:100; background:#cccccc; height:100px; }
* html div#main1 { position: absolute; }
* html div#main1{ top:expression(eval(document.compatMode && document.compatMode==’CSS1Compat’) ? documentElement.scrollTop : document.body.scrollTop); }
#main2{ width:900px; padding-top:20px; z-index:-1; }
p{ padding:5px; line-height:1.5em; }
</style>
You can see the css *html div#main1 I have used here, which is for Hacking the IE to make the position as fixed. Also the CSS1Mode and scrollTop which makes IE to make the rest of the div scroll top.
Vertically centering in CSS
Posted April 24, 2009
on:- In: CSS
- Leave a Comment
Most of us might have seen when working with divs valign doesn;t seem to work. So to make it align exactly vertically align center we normally make use of padding-top and padding-bottom property. Rather then using this there is another solution for this. Try using the below code:
<div id=”outerdiv” class=”border”>
<div id=”middlediv”>
<div id=”innerdiv” class=”border”>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p>
</div>
</div>
</div>
<style type=”text/css”>
#outerdiv { height:400px;overflow: hidden; position: relative;}/* for explorer only */
#outerdiv[id] {display: table; position: static;}/* other than IE */
#middlediv {position: absolute; top: 50%;} /* for explorer only */
#middlediv[id] {display: table-cell; vertical-align: middle; position: static;}/* for other than IE */
#innerdiv {position: relative; top: -50%}
.border {border: 1px solid #666666; }
</style>
Related to this
Vertical Align Div Bottom
Search Engine Submission Links
Posted April 20, 2009
on:Here are some of the links where you can submit your site for free for crawling.
1. Google : Click Here
2. Yahoo : Click Here
3. MSN : Click Here
4. Guruji : Click Here
5. Alexa : Click Here
Types of CSS styles
Posted April 20, 2009
on:- In: CSS
- Leave a Comment
There are three types of CSS styles:
1. Inline Styles : Inline styles are nothing but the styles written in the tag on the document. These styles affect only to the applied tag.
EX: <div style=”width:300px;height:30px;float:left;”>Some text here </div>
2. Embedded Styles : Embedded styles are nothing but that are embedded with the head section of the document. Embedded styles affect only the tags on the page they are embedded.
EX:
.text{
text-align:left;
font-family:Verdana,Arial;
font-size:12px;
}
3. External Styles : External Styles are those that are written on a separate document and which is intern attached to other pages. External styles can affect to any document that are attached to.
EX: <link href=”css/styles.css” rel=”stylesheet” type=”text/css”>
The best practice is to use always External Styles. Which saves your lot of time and money.
!important
Posted April 17, 2009
on:- In: CSS | Tutorials
- Leave a Comment
Everyone might have faced problem saying that my sight looks fine in mozilla firefox, but it is off by one or two pixels in Internet Explorer. The CSS will use the rule that it saw at last, that is the one that is defined at last will be used.
Ex:
li{
margin-left:2px !important;
margin-left:5px;
}
The Internet Explorer will use the 5px where as the firefox will use the 2px. Now the left margin for firefox will be 2px and for IE it will be 5px. You can see that such fixes are better than using Seperate CSS for Internet Explorer.
How to Backup Drupal site
Posted April 16, 2009
on:Backing up your Drupal site is now very easy, just need to download and install the Backup & Migrate Module. To install the module click on the Administer> Modules check the Backup and Migrate module and enable it and save the settings.
Then go to the Administer > Content Management > Backup and Migrate then make the following settings
1. Exclude the following tables altogether: select the table which you dont want to take backup .
2. Give the backup file name.
3. There are also options to compress the file before download, or add a datestamp.
And then click Backup Database.
Backup and Migrate is the easiest module that is available. The other method would be through PhpMyAdmin.
How to Increase Page Rank?
Posted April 15, 2009
on:Here are some of the steps how can you increase your page rank.
1. Update Content : Update your content regulary so that you can have unique content on your site. Which gets you more and more visitors to your site, which indirectly increases your page views and so the page rank also.
2. Inside Linking : You need to provide inside linking in your website that is if you have any blogs in your site, so provide a link for previous blog and next blog when the user is viewing your blogs. Which keeps him more time on your site.
3. Create Sitemap : Create a XML sitemap and submit it to google and yahoo. You can generate XML sitemap either manually or from some sitemap generator website.
4. Linking with other Website : Have linking with other websites that is put their link on your website and put your link in their. Which will help your visibility in search engine more.
Drupal Taxonomy Tutorial
Posted April 10, 2009
on:- In: Drupal
- 3 Comments
Drupal is one of the best and Award winning CMS, and one of its best feature is taxonomy.
New users to Drupal can find it bit difficult to understand this feature at first, which even I found it to be difficult for me at first.
Taxonomies are nothing but which allows you classify content into categories and subcategories. Drupal taxonomy is made up of vocabularies and terms. A vocabulary is a set of terms and terms are just another word for categories.
To look more into the Taxonomy, first log into the administrative block of your site. Then click on the Administrative link on the left menu. Find for the taxonomy(which comes under ( Content Management ) link click on that.
Let’s build the taxonomy for a news site as an example. First click on the Add vocabulary tab. Fill all the details into the boxes that is the Vocabulary name, some description, types and hierarchy and save the settings.
The vocabulary has been created, but there are no terms categories in it yet. Click on the Add terms link. Enter the term name, description select the parent and then save the settings. Continue the same procedure for those many terms and vocabularies you need.
For Example this could be the structure:
News [this is the name of your vocabulary]
- Business
- Markets
- Commodities
- Mutual Funds
- Cricket
- Latest
- Live Cricket
- Technology