Hi All,
I wanted to achieve the following layout.
basically 1 div placed inside the other.
Div1 has circle as background image.(size of div varies)
I want to position Div2 so as i always get the above layout
I tried using centering a div inside another ..didnt work.
Do I have to specify top and left for Div2??
I want to be able to define Div2 dimension wrt Div1.
Any help.
Edit
Using the following styles and js
.circle
{
width: 176px;
height: 176px;
top: 0;
left: 0;
background: url('images/circle.png') no-repeat left top;
display :block;
}
.inner {
position: absolute;
height: 80px;
margin: auto;
overflow :hidden;
white-space:normal;
}
Jquery :
//parent is the container c
var $circle_div = $("<div>").attr({ id: "circle_" + id });
$circle_div.addClass("circle");
parent.append($circle_div);
$circle_div.css({ "top": 100, "left": 200, position: 'absolute' });
var $inner_div = $("<div>").attr({ id: "text_" + id });
$inner_div.addClass("inner");
$inner_div.html("text_circle_333333333333444444444444" + id);
$circle_div.append($inner_div);
Thanks All