登录 | 注册 | FAQ
Anonymous

CSS negative px value

+ 发表回复

4 篇帖子 分页: 1 / 1


CSS negative px value

joe1211 » 周六 6月 14, 2014 10:57 pm

i want to over lap one div element which is blow the other one ! both of them are in another parent div! i dont want to use negative px. Can anybody suggest !
头像

joe1211

  • 帖子: 3
  • 注册: 周六 6月 14, 2014 10:55 pm

Re: CSS negative px value

merlin » 周日 6月 15, 2014 12:19 am

Is this of any help?
<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8">
<title> </title>
<link rel="stylesheet" href=".css">
<script src="multi.js"> </script>
<!--[if lt IE 9]>
<script src="components/dist/html5shiv.js"> </script>
<![endif]-->

</head>

<body style="position:relative;">


<div style="border:5px solid red; height:200px;">
<p> TEST </p>
</div>

<div style="border:5px solid blue; height:200px; width:500px; position:absolute; top:100px;">
<p> TEST </P>
</div>

</body>
</html>
头像

merlin

  • 帖子: 44
  • 注册: 周日 12月 19, 2010 3:31 pm

Re: CSS negative px value

joe1211 » 周日 6月 15, 2014 1:38 am

Thank you merlin !
头像

joe1211

  • 帖子: 3
  • 注册: 周六 6月 14, 2014 10:55 pm

Re: CSS negative px value

merlin » 周日 6月 15, 2014 11:51 am

Glad to help.

Remember, the position relative goes in the parent div. I put it in the body for brevity.
头像

merlin

  • 帖子: 44
  • 注册: 周日 12月 19, 2010 3:31 pm


+ 发表回复

分页: 1 / 1