I want to place abox within a box. I want the small container inside the container. Here is the code:

<head>
<title></title>
 
<style type="text/css">
<!--
#container{ position: absolute; top:200px; left:200px; height: 300px; width: 300px;
 
}
#smallcont{
position: absolute; top: :10px;left: 10px
}
-->
</style>
</head>
<body>
<div id="container"
<div id="smallcont">
<img src="#" height="300" width="300" />
</div>
<p>hello</p>
</div>
</body>
</html>

The HTML is correct. The CSS isn't. You should declare the smaller container to use relative positioning. Study the differences between relative and absolute positioning.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.