my problem is that my width is set to a strict width for the page. Once we have any border around a div tag... it makes it wider. that is why i am trying to get something to appera on top of the inner area
Main Topics
Browse All TopicsI basically have one div tag that is going to over lap another div tag...
<div>
<div id='inner'>
Some dynamic content, can be any size.....
</div>
</div>
I need to have the outer div tag lie on top of the inner div tag. With a dashed border directly on top of it.. The same length and height of the inner div tag.
So if the inner div is 100 X 100...The outer div needs to be 100 X 100 directly on top of the inner with nothing but a dashed border...
Any help much appreciated
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
having your "outer" div on top of the "inner" div won't change the way the widths of elements are calculated.
set your width on a block element that does not have a border and use the default width ("width: auto") for the block element that has the border:
<div style="width: 10em;">
<div style="border: 10px solid red;">
Some dynamic content, can be any size.....
</div>
</div>
Business Accounts
Answer for Membership
by: GrandSchtroumpfPosted on 2006-06-29 at 16:13:26ID: 17014451
Can i ask you why you want the outer div to be on top if it's transparent?
4/strict.d td">
ee/transpa rent_check ers.png);
Is it to stop the user from interacting with the content of the inner div?
I came up with the code that follows which works fine in IE, FF and Opera...
All browsers still allow text selection and FF even allows interaction with the form controls for some strange reason.
I had to add an additional div to make it work in FF and use a hack for IE that always needs special treatment.
And i added a transparent/black checkered backgound image to the outer div to show that it is on top...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8'/>
<title>Test</title>
<style type="text/css">
body {
background: #eee;
color: #111;
}
#outerer {
position: relative;
z-index: 1;
}
* html #outerer {
position: static;
}
#outer {
border: 1px solid black;
background: url(http://www.serger.biz/
}
#inner {
position: relative;
z-index: -1;
color: red;
font-size: 200%;
font-weight: bold;
}
</style>
</head>
<body>
<div id='outerer'>
<div id='outer'>
<div id='inner'>
Some dynamic content, can be any size.....
<input type="button" value="hello">
<input type="text" value="world">
</div>
</div>
</div>
</body>
</html>