Monthly Archives: August 2013

How to create 3D image by using multiple text shadows?

    • This property give designers and css coders a tool to give multiple text effects. Earlier which could only be done by giving effects to an image. There are various advantages of this property.
      1. As Text in an image is not searchable by search engines.
      2. CSS file size is very small in comparison to an image.
      3. Easy to update.
    • Final result

www.phpmind.com

  • Very simple and easy to use code which gives 3D look to your text.
  •     text-shadow: 0 1px 0 #3cc4fc,
                   0 2px 0  #4fcbfe,
                   0 2px 0 #5dd0ff,
                   0 3px 0 #6bd3fe,
                   0 4px 0 #78d5fc,
                   0 4px 1px rgba(0,0,0,.1),
                   0 0 5px rgba(0,0,0,.1),
                   0 1px 3px rgba(0,0,0,.3),
                   0 3px 5px rgba(0,0,0,.2),
                   0 5px 10px rgba(0,0,0,.25),
                   0 10px 10px rgba(0,0,0,.2),
                   0 20px 20px rgba(0,0,0,.15);
    }
  • Browser support: The text-shadow rule is supported by many modern browsers including IE10.
Share

How to use box-shadow property in CSS3 ?

Image0111

  • We have a very simple html code here. There is one div and an image of 400 x 300 under that div.
  • We will do some basic styling by mentioning its width, background colour and place it in a center by using margin property. I am going to opt for #efefef as a background colour.
    body {	
    	width:400px;
    	background-color:#efefef;
    	margin:100px auto;
         }

    shadow-1

  • Our next step is to give styling to the class “container” which is the main div of the code. We will apply -webkit-box-shadow property for webkit supporting browsers, -moz-box-shadow for mozilla abd box shadow. I am using 2px for horizontal shadow(h-shadow), 3px for vertical shadow(v-shadow), 5px for blur distance and rgba colour value. Some more basic properties like margin and padding and background colour to white.Now as we can see that image is slightly bigger.  To fix it up we will use max-width property.

    shadow-eg

    .container {
    	width:400px;
    	-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.5);
    	-moz-box-shadow: 3px 3px 5px rgba(0,0,0,.5);
    	box-shadow:3px 3px 5px rgba(0,0,0,.5);
    	padding: 20px;
    	margin:0 auto;
    	background: white;}
    .container img {	
    	max-width:100%;
    	max-height:100%;
    	border:1px solid #666;}

    shadow-2

  • We can give variations by using inset property to give depth at the top and left side of the image.

     

    shadow-eg1

    shadow-3

    .container {
    	-webkit-box-shadow:inset 2px 3px 5px rgba(0,0,0,.5);
    	-moz-box-shadow:inset 2px 3px 5px rgba(0,0,0,.5);
    	box-shadow:inset 2px 3px 5px rgba(0,0,0,.5);
    	padding: 20px;
    	margin:0 auto;
    	background: white;
    }
  • Browser support: The box-shadow property is supported by many modern browsers including IE9+, Firefox 4, Chrome, Opera, and Safari 5.1.1.
Share

Advantages of Online banner Ads ?

    • Large Traffic: You can provide high traffic to your business website by placing your ads on any other website that is getting high traffic. With banner ads, you can put your message in front of future customers.
    • Easy maintenance: It is very easy to create eye-catchy banner for your website services. Banner Advertisements are easy to maintain. You can change it, remove it according to your need.
    • Cost Effective: If you have a limited budget for marketing your website then It is a very good option. You can go for a banner according to your budget.
    • Build your brand: If your website is new or your company is not a very well known company, then banner ads can play an important role in attracting an audience to your website. Banner ads allow you to bring your website name and even your company logo in front of your future customers.
    • Targeted Audience: They can be used to target a large group of audience who are looking for the same kind of services provided by your website.
      If you are interested in increasing the number of your website visitors, customers, sales and services by attracting the attention of your target market online. Then displaying an online banner of your website is a very good option.
  • Easily Measure Your Results: Banner ads provide direct traffic to your website. It is easy to calculate the traffic which is delivered from the banner advertisements.
Share

How to convert PHP array in diffrent kind of json objects?

JSON objects are used everywhere and very easy to implement.
Thanks to PHP it has inbuilt function but if you want different kind of json object which is possible based on requirement. In my case i wanted to use
var availableTags = [{“key”:1,”value”:”AERO 1″},{“key”:2,”value”:”AERO 3″},{“key”:3,”value”:”AIR CANADA 4″},{“key”:6,”value”:”AIR CANADA 26″},{“key”:7,”value”:”AIR CANADA JAZZzzz”}];

if have key value pair of array json_encode($yourArray) will not return
above format!

Well that was my requirement, yours could be different but here is the solution.
You can tweak little bit and ready to go!

 $value)
{
   if(empty($key) && empty($value))
   {
	  continue;
    }
	$temAccNameArray[] = array('key' => $key,'value'=>$value);
}
echo json_encode($temAccNameArray);
?>;
Share

How to prevent form submission by pressing entering key?

Stop form submission by pressing enter key.
this code will prevent form posting by pressing enter key or save time accidental form submission.


All form element and your code here.
Share