Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to overlap a image on a div?

Tags:

html

css

z-index

I want to place a small circular login image on the border of div such that half image will be outside the border line just for style purpose?I think I have to set z-index but how OR is there any better way?

like image 301
nectar Avatar asked Dec 22 '22 00:12

nectar


2 Answers

Thats exactly what you need to do.

Give you img a class name. Then in your style sheet add something like this

#classname  
{
position: absolute;
z-index: 10;
top: #distance from top of page#
left: #distance from left of page#
}

z-index needs to be a number greater than your div which will have an index of 0 if you haven't changed it.

Hope this helps.

like image 72
Ash Burlaczenko Avatar answered Jan 12 '23 20:01

Ash Burlaczenko


.overout {  
text-decoration:none;
position: relative;
z-index: 10;
top: 105px;
right: -25px;
}
like image 26
nectar Avatar answered Jan 12 '23 18:01

nectar