Colorbox : Change Position of Close Button To Top Right

Hi Friends, After many days now I am again back to blogging. Today I am going to write about one small thing  about Colorbox (A lightweight customizable lightbox plugin for jQuery).When I implemented Colorbox in one of my client site, My client liked it very much but he got one comment only that he want close button at top right corner because we all mostly have habit to find close button at top right corner because close button always found on top right corner of Browser, Windows etc ..

So to make this I thought first that I need to change some html part of colorbox script but finally I found one easiest way to do it by CSS. So to make close button at top right corner, You need to add one CSS block to colorbox CSS. Below is CSS block which you need to add in colorbox CSS :

/* To change position of close button to Top Right Corner */
#colorbox #cboxClose
{
top: 0;
right: 0;
}
#cboxLoadedContent{
margin-top:28px;
margin-bottom:0;
}

Add this to your CSS file or Colorbox CSS file and then you can see close button will automatically show on top right corner of Colorbox.

Also I am PHP Freelancer, Freelance PHP Developer having more than 5 years of experience, So if you want to do any projects then you can contact me.

Hostgator Hosting in 1 Cent Coupon Code – “1CENTHECOUPON” (Without Quotes).

Subscribe to PHP Freelancer

Enter your email address: