How to Avoid ugly border around images & links using css

Posted by admin | CSS, HTML | Thursday 1 October 2009 10:36 am

Every web developer would come across this issue. In Firefox, when you’d clicked a image or link there you’ll see a dotted border around the image or link. It makes ugly to the website. I googled around this issue & found a way to resolve it. If you see the image below you could easily identify the bug.

To resolve this issue just a single line css is enough.

<style type="text/css">
a:active, a:focus{outline: 0;}
</style>;

Courtesy:  mycodings.blogspot.com

 

email validation using regular expression with PHP

Posted by druva | CSS, php, utils | Tuesday 23 December 2008 7:05 am

<?php
if(!empty($_POST['email'])){
	$regularexp = "^[A-Za-z0-9\.|-|_]*[@]{1}[A-Za-z0-9\.|-|_]*[.]{1}[a-z]{2,5}$";
	$email = $_POST['email'];
	$validemail = ereg($regularexp, $email);
	if ($validemail)
	{
		echo "<div style='color:green;'> <b>'$email'</b> is a valid email</div>";
	}
	else
		echo "<div style='color:red;'> <b>'$email'</b> is not a valid email</div>";
}else{
	echo "<div style='color:red; font-weight:bold;'> Please enter email</div>";
}
?>
<html>
	<body>
	<h2>Email Validator</h2>
	<form method="post">
		<div style="width:50px; font-family:Verdana, Arial, Helvetica, sans-serif; float:left; padding-top:3px;">
			Email:
		</div>

		<div style="width:300px">
			<input type="text" name="email" />
		</div>

		<input type="submit" />
	</form>
	</body>
</html>
 

Fly move according to the mouse movement

Posted by druva | CSS, Flash, as3, utils | Sunday 21 December 2008 2:45 am

This code shows the movement of the object fly according to the mouse movement


var flySpeed:Number = 0.1;

fly.addEventListener(Event.ENTER_FRAME,flyMove);

function flyMove(event:Event):void {

	var fly_x:Number = (mouseX - fly.x) * flySpeed;
	var fly_y:Number = (mouseY - fly.y) * flySpeed;
	var angle = Math.atan2(fly_y, fly_x);
	fly.x += fly_x;
	fly.y += fly_y;
	fly.rotation = 90 +(angle * 180 / 3.141593E+000);

}

This movie requires Flash Player 9

 

CSS unicode-bidi using html

Posted by druva | CSS, HTML, utils | Thursday 18 December 2008 7:03 am

This code shows how to display text with different reading directions


<html>
	<body>
		<p style="direction:rtl;">
			Text using right to left direction
		</p>

		<p style="direction:rtl; unicode-bidi:bidi-override">
			Text using right to left direction and unicode-bidi
		</p>
	</body>
</html>