KSJ10 KSJ10 - 7 days ago 8
CSS Question

Can I set position of an element in css with respect to another element?

I want to set the bottom of the following div according to 100px less than the 100% of the page. Can I do this. (The following code doesn't work)



div{
position:absolute;
height: 50px;
width:50px;
background-color:#000000;
left:40px;
BOTTOM:100% - 100PX;
}

<div></div>




Answer

You might be looking for:

bottom: calc(100% - 100px);
Comments