Easy CSS Tooltip

css tooltip

css tooltip

Here we will see a tooltip using css only. Its really short and easy. We are using here a span inside a anchor tag for tooltip text. Hope it will be useful for you.

Source Code

<html>
<head>
<style type="text/css">
* {font-family:Verdana; font-size:11px; }
a:hover {background:#ffffff; text-decoration:none;} /*BG color is a must for IE6*/
a.tooltip span {display:none; padding:2px 3px; margin-left:8px; width:190px;}
a.tooltip:hover span{display:inline; position:absolute; border:1px solid #cccccc; background:#ffffff; color:#6c6c6c;}
</style>

</head>
<body>
	<form>
		<a href="#" class="tooltip">
			See Tooltip <span>https://designikx.wordpress.com</span>
		</a>.
		<a href="#" class="tooltip">
			<input type="text">
			<span>https://designikx.wordpress.com</span>
		</a>
	</form>
</body>
</html>

Thanks,
Nikhil Ughade
(WEB DeSigNer)
Mumbai,IN

Nikhil on Deviant Art
http://designikx.deviantart.com
Art – community of artists and those devoted to art. Digital art, skin art, themes, wallpaper art, traditional art, photography, poetry / prose. Art prints.

Nikhil on Twitter
http://twitter.com/designikx

Advertisements

Draggable div using javascript

Draggable div using javascript

draggable-div

Draggable DIV using javascript

download source code from here draggable div

Rounded Corner Div Using CSS only

Rounded corner div using css

 Download the source code – click here

Use of Z-index property in CSS

Z-Index

Its the stack order of element.
Higher the Z-index value of an Element  means closer to the top of stack order.

Lets see the example :
I have taken Two DIVs (Div1 and Div2)

<div id="yellowblock"></div>
<div id="blueblock"></div>

then I styled it as

<style>
#yellowblock {
z-index: 1;
position: absolute;
width:80px;
height:100px;
top:20px;
left:20px;
border: 1px solid #FFF;
background-color: #f3b02e;
}

#blueblock {
z-index: 2;
position: absolute;
width:100px;
height:80px;
top:50px;
left:50px;
border: 1px solid #FFF;
background-color: #02b9cf;
}
</style>

Its Output :

When I interchange there Z-indexes as:

<style>
#yellowblock {
z-index: 2;
position: absolute;
width:80px;
height:100px;
top:20px;
left:20px;
border: 1px solid #FFF;
background-color: #f3b02e;
}

#blueblock {
z-index: 1;
position: absolute;
width:100px;
height:80px;
top:50px;
left:50px;
border: 1px solid #FFF;
background-color: #02b9cf;
}

</style>

its output is :

The javascript syntax for using Z-index is

document.getElementById("blueblock").style.zIndex = "4";

Some Facts-
z-index only works on elements that are positioned.

Hope this post will be useful for you.
Please share / recommend if you like this post.

Thanks,
Nikhil Ughade
UI Designer
Mumbai[INDIA]

%d bloggers like this: