Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Elements with same atttributes are differenly positioned on my page

Status
Not open for further replies.

lupidol

Programmer
Apr 23, 2008
125
0
0
IL
Hi everyone,
My page contains 2 elements with identical attributes' values but they are differently positioned on the page !
My code:
Code:
<!doctype>
<html>
<head>
<style>
<style type="text/css">
	{
		margin: 0;
		padding: 0;
		border: 0;
		font-size: 100%;
		font: inherit;
		vertical-align: baseline;
	}
	.first {position: relative;border:1px solid red; width:70%; max-width:70%; height: 50%; max-height:50%; margin-left:15%;top:30%;}
	.second {position: absolute;border:1px solid green; width:70%; max-width:70%; height: 50%; max-height:50%; margin-left:15%;top:30%;}
</style>
</head>
<body>
<p class = "first">abcd</p>
<p class = "second">abcd</p>
</body>
</html>
This is what the page looks like:
to_forum_xy6ao3.gif

Could anyone help me positioning the second element so it will overlap the first?
 
one is 'relatve' the other is 'absolute'

that's the way it works.


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind these jesus character, stars had to die for me to live.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top